![]() |
Starburst image in short description
When a product has a discount it usually shows the list price and the discount price but also it displays a starburst image on the product page which contains the discount in percentages.
How can I make this star to appear on the short description in category view ? Thank you. |
Re: Starburst image in short description
Quote:
Try use next code (for file "skin1/customer/main/products.tpl" or ".../products_t.tpl"): PHP Code:
|
Re: Starburst image in short description
Quote:
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} |
Re: Starburst image in short description
Try this...
{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}> {if $discount gt 0} <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>{/if} </td> {/if} |
Re: Starburst image in short description
Quote:
Try use next code: PHP Code:
If you do not want to show discount "0%" should be changed first condition PHP Code:
|
Re: Starburst image in short description
Anyone knowds if this code goes in
skin1/customer/main/products.tpl" or ".../products_t.tpl? And about where to put the code? Just thought I asked before I start messing around on a live store. Hope I can get an answer. |
Re: Starburst image in short description
I am trying to reimplement the same code as here on 4.4.1 version but it seems it doesn't work .
Has anybody got an idea how I can make this modification on 4.4.1 ? Thank you |
Re: Starburst image in short description
I just found the answer myself the class name is changed in 4.4.2 so just copy this code in /customer/main/product.tpl
{if $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/product_bp_icon.tpl"} {/if} {if $product.appearance.has_market_price and $product.appearance.market_price_discount gt 0} <td align="right" valign="top"> <div class="save-percent-container"> <div class="save" id="save_percent_box"> <span id="save_percent">{$product.appearance.market_pric e_discount}</span>% </div> </div> </td> {/if} I am trying now to align it to the right but I am not able to . Can anybody help me ? Thank you . |
All times are GMT -8. The time now is 12:03 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.