Jump to content

Hide Old-Price if same as New Price


Recommended Posts

Hi,

I have an issue on my product-list pages. Basically I have some products which are discounted and some that are not.

The products that are discounted are fine because they show the old price and then the new discounted price.

My problem is with the producst that HAVE NOT been discounted. They show the old price and discounted new price which are actually the same figure, as there is no discount.

What I would like to be able to do is ONLY show an old and new price when there is a difference between the 2 prices, otherwise I would only like one price displayed.

Does anyone know if this is possible?

Thanks

Link to comment
Share on other sites

  • 1 year later...

Hi Steveio,

I think in your product.tpl you should change, in line 122 (where old price is displayed) :

{if $productPriceWithoutReduction > $productPrice}

with

{if $productPriceWithoutReduction|round:'2' > $productPrice|round:'2'}

In fact Prestashop compares here the price values before being rounded, which sometimes gives unequal prices on a more precise scale (ex : 20.000$ and 20.004$).

Best regards,

Mehdi

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