Cosmi Posted August 7, 2010 Share Posted August 7, 2010 Hello,I'm facing a new situation. I need to display the old price (with no reduction) in category page.I tried to copy the code from product.tpl to product-list.tpl but it gives me a blank error.Is there a way to solve this issue?Thanks`Cosmi Link to comment Share on other sites More sharing options...
theepan Posted September 18, 2010 Share Posted September 18, 2010 i kinda have same problemi have different discount for membersso i need to display both price in product-list page ; ; Link to comment Share on other sites More sharing options...
Cosmi Posted January 25, 2011 Author Share Posted January 25, 2011 This was a mandatory thing on my client website, so I had to deal with.The solution is very simple and is pure math. Insert the following code in product-list.tplPlease notice that this works only with percentage reductions (it's easy to make it work for the other reduction type but I don't have much time to develop): {if ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product.reduction_from))} {math equation="(price/(1-(reduct/100)))" price=$product.price reduct=$product.reduction_percent format="%.2f"} {/if} Link to comment Share on other sites More sharing options...
subpage Posted May 12, 2013 Share Posted May 12, 2013 Hello, I have presta 1.5.4 and here it does not work. Do you have solutions for this version please? Link to comment Share on other sites More sharing options...
balrajmalai Posted May 15, 2013 Share Posted May 15, 2013 Hello, in the product-list.tpl you can add after <div class="left_block"> {math equation=" round(( rprice - sprice ),0) " rprice=$product.price_without_reduction sprice=$product.price assign=discountper} {if ($discountper > 0 )} <div id="discountper"><span id="discountper_display">{$discountper}</span> </div> {/if} =========================================== it worked for me ... if any one has better solution kindly let me know, thanx 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