Jump to content

Display new-label and special-label on viewed products block items?


Egocefalo

Recommended Posts

You must copy this piece of code (taken from product-list.tpl) and paste it at the desired place and file.

 

{if isset($product.new) && $product.new == 1}
<a class="new-box" href="{$product.link|escape:'html':'UTF-8'}">
<span class="new-label">{l s='New'}</span>
</a>
{/if}
{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
<a class="sale-box" href="{$product.link|escape:'html':'UTF-8'}">
<span class="sale-label">{l s='Sale!'}</span>
</a>
{/if}
 
Well. it is possible you have to change it a little. Main point is to add the if condition and the label span:
{if isset($product.new) && $product.new == 1}
<!--your current box showing the product-->
<span class="new-label">{l s='New'}</span>
 
{/if}
{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
<!--your current box showing the product-->
<span class="sale-label">{l s='Sale!'}</span>
 
{/if}
 
 
Always make a backup of the file you are about to modify
Edited by nutxlago (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...