Quote:
Originally Posted by Isleman
Thanks a lot . Is working very nice now.
However I get a problem as it shows on all the products even if they haven't been discounted.
Id the product has not been discounted it will show 100%
Obviously it needs an if condition which I copied from product.tpl . But somehow it doesn't work . Is anything else that needs included ?
|
Try use next code:
PHP Code:
{if $products[product].taxed_price gt 0 and $products[product].list_price gt 0}
<table width="60" cellspacing="1" cellpadding="2">
<tr>
<td class="SaveMoneyLabel">
<br />
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
<span id="save_percent">{ $discount }</span>%
</td>
</tr>
</table>
{/if}
If you do not want to show discount "0%" should be changed first condition
PHP Code:
{if $products[product].taxed_price gt 0 and $products[product].list_price gt 0 and $products[product].list_price ne $products[product].taxed_price}