From 1c59955c9ac3f3120b4aca58da8c4a4b0afaceac 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 The previous values are rounded to 2 decimals in the following method: 1. Order::getOrders() 2. Order::getProductsDetail() 3. 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 values provided by the Core. --- mailalerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailalerts.php b/mailalerts.php index 3b31064..821dbfa 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']]))