| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Starburst image in short description | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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.
__________________
X-Cart ver. 4.4.2 ( www.responseelectronics.com ) X-Cart ver. 4.1.11 ( www.mrdoorbell.com) |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Starburst image in short description
Quote:
Try use next code (for file "skin1/customer/main/products.tpl" or ".../products_t.tpl"): PHP Code:
|
|||||||||
#3
|
|||||||
|
|||||||
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}
__________________
X-Cart ver. 4.4.2 ( www.responseelectronics.com ) X-Cart ver. 4.1.11 ( www.mrdoorbell.com) |
|||||||
#4
|
|||||||||
|
|||||||||
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}
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#5
|
|||||||||
|
|||||||||
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:
|
|||||||||
#6
|
|||||||
|
|||||||
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. |
|||||||
#7
|
|||||||
|
|||||||
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
__________________
X-Cart ver. 4.4.2 ( www.responseelectronics.com ) X-Cart ver. 4.1.11 ( www.mrdoorbell.com) |
|||||||
#8
|
|||||||
|
|||||||
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 .
__________________
X-Cart ver. 4.4.2 ( www.responseelectronics.com ) X-Cart ver. 4.1.11 ( www.mrdoorbell.com) |
|||||||
|
|||
X-Cart forums © 2001-2020
|