Entcee Posted September 24, 2009 Share Posted September 24, 2009 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 More sharing options...
mr_c Posted September 24, 2009 Share Posted September 24, 2009 I recommend you report it as a bug in the bug tracker (http://www.prestashop.com/bug_tracker/) the presta people will look at it and reply, if it is in fact a bug, they'll try to fix it for the next version. Link to comment Share on other sites More sharing options...
Entcee Posted September 24, 2009 Author Share Posted September 24, 2009 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 More sharing options...
mr_c Posted September 24, 2009 Share Posted September 24, 2009 great! paste the fix in the comments in the bug reported so they can simply easily fix it and have it fixed in the next version for people who might have the same problem in the future. Link to comment Share on other sites More sharing options...
gianvi Posted March 10, 2010 Share Posted March 10, 2010 Just a question :if i have a price of 599,00 and i apply a 35% discount, i will have 389,35.Where i have to run on the code to have 389,00 ?i try to modify the code as described up, but no results.Tks for your help Link to comment Share on other sites More sharing options...
Hardik Posted April 1, 2010 Share Posted April 1, 2010 you will have to go to tools.php in classes/tools.phpgoto the "convertPrice" functionround($price,-1); might help, but you'll have to try it out Link to comment Share on other sites More sharing options...
Recommended Posts