Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
[-] MO: Fix rounding error in new order email
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
mcdado committed Dec 1, 2015
1 parent d923aed commit 1780ad4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mailalerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']]))
Expand Down

0 comments on commit 1780ad4

Please sign in to comment.