Jump to content

Hard Coding a Text


Recommended Posts

This is how you can find code segments in tpl files.

1) Find text that appears near what you're looking for. It has to be text stored in the code, not the database. In this instance I used "tax incl."
2) Open all tpl files in Notepad++.
3) Search for the word, "tax incl.", and then hit the button.
4) Sort through the results until you find one that looks right.

<!-- prices -->


               {if $product->on_sale}

{l s='On sale!'}
               {elseif ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))}
{l s='Price lowered!'}
               {/if}



               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}
               {if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if}

               {if $priceDisplay == 2}


{convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'}
               {/if}



           {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))}


               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPriceWithoutReduct()}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}
               {if $priceDisplay == 1}
{convertPrice price=$product->getPriceWithoutReduct(true)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if}


           {/if}
           {if $product->reduction_percent != 0 && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))}

{l s='(price reduced by'} {$product->reduction_percent|floatval} %{l s=')'}
           {/if}
           {if $packItems|@count}

{l s='instead of'} {convertPrice price=$product->getNoPackPrice()}


           {/if}
           {if $product->ecotax != 0}

{l s='include'} {convertPrice price=$product->ecotax} {l s='for green tax'}
           {/if}

           {if isset($groups)}



I'd recommend adding "This Item qualifies for Free Shipping" either before the pricing or just after the 'ecotax' and 'pack count'.

If you want to make it conditional, you can try something like...

{if $free_ship > price}
             {l s='This Item qualifies for Free Shipping!'}
{/if}



Though, forewarning, I don't know Smarty, I'm not all that familiar with PrestaShop's variables, and I haven't tried that.

Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...