Quote:
Originally Posted by Yurij
Try use next code (for file "skin1/customer/main/products.tpl" or ".../products_t.tpl"):
PHP Code:
<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>
|
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 ?
Heres is the code
<tr>
{if $product.taxed_price gt 0 and $product.list_price gt 0}
<td align="right" valign="top" width="60" id="save_percent_box"{if $product.taxed_price >= $product.list_price} style="display: none;"{/if}>
<table width="60" cellspacing="1" cellpadding="2">
<tr>
<td class="SaveMoneyLabel">
<br />
{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount}
<span id="save_percent">{ $discount }</span>% </td>
</tr>
</table> </td>
{/if}