From 7402d7b93d269ec221cbc436673d604f19221e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 13 Feb 2013 17:48:40 +0100 Subject: [PATCH] [-] Core: Fix rounding price computation with and without taxes #PSCFV-7796 --- classes/Product.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index d4db0e7d6..3855b2d11 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2668,7 +2668,6 @@ class ProductCore extends ObjectModel // Add Tax if ($use_tax) $price = $product_tax_calculator->addTaxes($price); - $price = Tools::ps_round($price, $decimals); // Reduction $reduc = 0; @@ -2680,14 +2679,14 @@ class ProductCore extends ObjectModel if (!$specific_price['id_currency']) $reduction_amount = Tools::convertPrice($reduction_amount, $id_currency); - $reduc = Tools::ps_round(!$use_tax ? $product_tax_calculator->removeTaxes($reduction_amount) : $reduction_amount, $decimals); + $reduc = !$use_tax ? $product_tax_calculator->removeTaxes($reduction_amount) : $reduction_amount; } else - $reduc = Tools::ps_round($price * $specific_price['reduction'], $decimals); + $reduc = $price * $specific_price['reduction']; } if ($only_reduc) - return $reduc; + return Tools::ps_round($reduc, $decimals); if ($use_reduc) $price -= $reduc; @@ -2700,7 +2699,6 @@ class ProductCore extends ObjectModel $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100); } - $price = Tools::ps_round($price, $decimals); // Eco Tax if (($result['ecotax'] || isset($result['attribute_ecotax'])) && $with_ecotax) {