Jump to content

[SOLVED] Item on sale :: Rounding problem


Recommended Posts

I have an item that is $4.99 but have it on sale at 20% off so the item is $3.99 (actually it is $3.992).

This is not a problem until someone buys 3 of them. When they do, the total should be $11.97 but the cart shows $11.98 (because the total is really $11.976).

Normally this would not be a problem but when the customer is transfered to PayPal's site, the total is displayed as $11.97. This creates a discrepancy between PayPal and Prestashop.

Anyone know what I have to change to get Prestashop to round each item separately (even when it is multiples of the same item) instead of rounding all the same items together?

Thanks in advance

Link to comment
Share on other sites

Thanks, I did note it in the bug tracker.

Since then, I found where to fix it...

classes\Product.php (approx line 1192)

I changed this:

elseif ($reduction_percent AND $reduction_percent > 0)
 {
  if ($reduction_percent >= 100)
   $ret = $product_price;
  else
   $ret = $product_price * $reduction_percent / 100;
 }
 return isset($ret) ? $ret : 0;




to this (look at the 6th line):

elseif ($reduction_percent AND $reduction_percent > 0)
 {
  if ($reduction_percent >= 100)
   $ret = $product_price;
  else
   $ret = round($product_price * $reduction_percent / 100, 2);
 }
 return isset($ret) ? $ret : 0;



Now it is working like I think it should!

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...
×
×
  • Create New...