Jump to content

[SOLVED] Display old price in category


Cosmi

Recommended Posts

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

  • 1 month later...
  • 4 months later...

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.tpl
Please 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

  • 2 years later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...