From 1780ad4b24636b90b86e76e6a103367052cebbfe Mon Sep 17 00:00:00 2001 From: David Gasperoni Date: Tue, 1 Dec 2015 22:05:27 +0100 Subject: [PATCH] [-] MO: Fix rounding error in new order email MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous values are rounded to 2 decimals in the following method: Order::getOrders =» Order::getProductsDetail =» Order::setProductPrices This is due to backwards compatibility with 1.4, but it can lead to rounding errors in the product lines in the email. Instead, here we are using other Core provided values. See example screenshot: http://cl.ly/image/0e0g2D1u0Y45 (the minus-minus on the coupon line is another issue) --- mailalerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailalerts.php b/mailalerts.php index 5e30f1e..aac7dd3 100644 --- a/mailalerts.php +++ b/mailalerts.php @@ -281,7 +281,7 @@ public function hookActionValidateOrder($params) Product::addCustomizationPrice($products, $customized_datas); foreach ($products as $key => $product) { - $unit_price = Product::getTaxCalculationMethod($customer->id) == PS_TAX_EXC ? $product['product_price'] : $product['product_price_wt']; + $unit_price = Product::getTaxCalculationMethod($customer->id) == PS_TAX_EXC ? $product['unit_price_tax_excl'] : $product['unit_price_tax_incl']; $customization_text = ''; if (isset($customized_datas[$product['product_id']][$product['product_attribute_id']]))