Jump to content

Wrong price in product page but right page on listing and cart


Recommended Posts

Hello,

 

I have been looking all over for a solution for this.

 

I have as store and almost all my products have combinations. Each combination has it's own price. On the category list and EVEN in the cart and checkout pages, price is shown ok, BUT in the product page an anoying decimal is misplaced.

 

For example. A product has a default combination with a price of 7,00€. this is shown fine in the category list and in the cart, but when I go to the product page, I see 7.01€.  This happens only with some amounts. 7 for example chages to 7.01. 10 changes to 9.99.

 

I know the problem is in product.js, as if I completaly DELETE the file, price is shown fine. I don't want to delete it because of course I asume that something will break latter on.

 

I have looked for hours and I have seen similar issues, but not any solution. I have restaured original prestashop product.js but nothing fixed it.

 

Anybody can help? 

 

thank you in advance

Link to comment
Share on other sites

  • 1 year later...

I had the same kind of issue. I solved it like this:

Go to controllers/front/ ProductController.php

Change this:

$combinations[$row['id_product_attribute']]['price'] = (float)($row['price'], null, Context::getContext()->currency, false);

To this:

$combinations[$row['id_product_attribute']]['price'] = (float)$row['price'];

 

This fixed my problem anyways. Hope it helps!

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