Jump to content
Mariu

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More