Bastia Posted May 17, 2010 Share Posted May 17, 2010 Hi everybody,In my product list (product-list.tpl), I'd like to display two prices: the one with the discount, and the one without the discount. So my customers can appreciate the discount.The discount is properly displayed on the product page, with the following line: {convertPrice price=$product->getPriceWithoutReduct()} But when I use it in product-list.tpl : <!-- {if $product.new == 1}{l s='new'}{/if} --> {$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'} {if $product.on_sale} {l s='Green Price'} <!-- On change le texte avec nos Green Price {l s='On sale!'} --> {elseif ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product.reduction_from))} #################### HERE ############## {l s='Price lowered!'} The price doesn't come out, and there is a graphic bug (my background image is not displayed).Would anyone know how to use this getPriceWithoutReduct() function ?I had a look at it, but I really don't get it...Thanks ! Link to comment Share on other sites More sharing options...
Bastia Posted May 18, 2010 Author Share Posted May 18, 2010 Solved on the French board, but I post the solution here, for people who might need it some day:Here's the bit of code used to display the crossed priced without the discount: {if $product.reduction_percent} {displayWtPrice p=$product.price_without_reduction}{if $priceDisplay == 2} {l s='-Tx' mod='homefeatured'}{/if} {/if} Enjoy Link to comment Share on other sites More sharing options...
Daan Tol Posted July 22, 2010 Share Posted July 22, 2010 HI, Thanks for the piece of code...but >> where do I have to place the piece of code...?I tried 3 options without result.Could you give a hand?Thanks in advance!Daanwww.serviezenonline.nl Link to comment Share on other sites More sharing options...
Bastia Posted July 23, 2010 Author Share Posted July 23, 2010 I used this piece of code in the module "home featured", which display products with promotions on the home page.You can put the code in /modules/homefeatured/homefeatured.tpl or something like that. Link to comment Share on other sites More sharing options...
theepan Posted September 19, 2010 Share Posted September 19, 2010 hi i kinda need help here... after u put on home .tplwhat code u write in produt-list,tplthakx Link to comment Share on other sites More sharing options...
Bastia Posted September 20, 2010 Author Share Posted September 20, 2010 Here the piece of code I have in product-list.tpl : <!-- ******* Affichage du prix avant la réduc --> {elseif ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product.reduction_from))} {if $product.reduction_percent} {displayWtPrice p=$product.price_without_reduction}{if $priceDisplay == 2} {l s='-Tx' mod='homefeatured'}{/if} {/if} {l s='Price lowered!'} {l s='-'}{if $product.reduction}{$product.reduction_percent}{l s='%'}{/if} {/if} {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$product.price}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if} {if $priceDisplay} {convertPrice price=$product.price_tax_exc} {if $priceDisplay == 2} {l s='-Tx'}{/if}{/if} Which display the price without discount (crossed), a sentence like "NEW PRICE !! -50% !" and the new price. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now