Jump to content

What code for commenting out


Recommended Posts

Good morning

 

Just a quick question that maybe useful to a lot of forum members.

 

What is the correct code for commenting out?

 

Is it: <!-- comment out --> or {* comment out *} or does this depend on whether it is html, css etc

 

I have seen conflicting answers on the forum so I hope this post and any answers will be helpful to all

 

Paul

Link to comment
Share on other sites

methods that you mentioned are related to the comments in the .tpl file (not .php)

 

if you will use <!-- COMMENT --> the code will appear in the page source, anyone will be able to see it.

if you will use {* COMMENT *} the code will not appear in the source, so no one will be able to see it.

 

im usually use second method - im absolutely sure then, that code isn't visible for guests and robots like google crawler etc.

Link to comment
Share on other sites

Thank you for your reply vekia

 

I think a lot of new users to prestashop or any other platform are not used to html, css, php, smarty or any other name, so, what would

 

you suggest would be the best way to comment out all file types

 

Paul

Link to comment
Share on other sites

  • 2 months later...

php - /** COMMENT **/

tpl - {* COMMENT *}

js - /** COMMENT **/

css - /** COMMENT **/

html - <!-- COMMENT -->

Hello Vekia,

 

In the backend under the price tab I would like  to remove the "Pre-tax retail price" and "Tax rule" fields. In the prices.tpl I have commented those sections but I get a black page when I click the price tab. Even just commenting the "Pre-tax retail price".

I have tried both methodes:

{* COMMENT *} and <!-- COMMENT -->

 

This is an example for commenting the "Pre-tax retail price":

{* <tr>

        <td class="col-left">

            {include file="controllers/products/multishop/checkbox.tpl" field="price" type="price"}

            <label>{l s='Pre-tax retail price:'}</label>

        </td>

        <td style="padding-bottom:5px;">

            <input type="hidden"  id="priceTEReal" name="price" value="{toolsConvertPrice price=$product->price}" />

            {$currency->prefix}<input size="11" maxlength="14" id="priceTE" name="price_displayed" type="text" value="[spam-filter]toolsConvertPrice price=$product->price}|string_format:'%.2f'}" onchange="noComma('priceTE'); $('#priceTEReal').val(this.value);" onkeyup="$('#priceType').val('TE'); $('#priceTEReal').val(this.value.replace(/,/g, '.')); if (isArrowKey(event)) return; calcPriceTI();" />{$currency->suffix}

            <p class="preference_description">{l s='The pre-tax retail price to sell this product'}</p>

        </td>

    </tr> *}

 

What else should I do?

 

Thanks

Edited by PSdilemma (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...