Hi
I'm assuming here that you have DISPLAY_PRICE_WITH_TAX = 'true'
Seems the tax calculation re-introduces the rounding bug.
I'm testing a fix at the moment, and while I have not yet promoted it to github, heres a git patch.
Code:
From b83f21bd295c0a8ebf31bbc8efdea9d8f5907253 Mon Sep 17 00:00:00 2001
Date: Fri, 23 Nov 2012 21:47:12 +0000
Subject: [PATCH] CHANGE-399 - order total different from cart total
Adjust previous fix to take account of DISPLAY_PRICE_WITH_TAX
---
includes/classes/order.php | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/includes/classes/order.php b/includes/classes/order.php
index 39b76bc..2023db6 100644
--- a/includes/classes/order.php
+++ b/includes/classes/order.php
@@ -439,13 +439,20 @@ class order extends base {
$rowClass="rowOdd";
}
$taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], $taxCountryId, $taxZoneId);
+ if (DISPLAY_PRICE_WITH_TAX == 'true')
+ {
+ $finalPrice = $products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']);
+ } else
+ {
+ $finalPrice = zen_round($products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']), $decimals);
+ }
$this->products[$index] = array('qty' => $products[$i]['quantity'],
'name' => $products[$i]['name'],
'model' => $products[$i]['model'],
'tax_groups'=>$taxRates,
'tax_description' => zen_get_tax_description($products[$i]['tax_class_id'], $taxCountryId, $taxZoneId),
'price' => $products[$i]['price'],
- 'final_price' => zen_round($products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']), $decimals),
+ 'final_price' => $finalPrice,
'onetime_charges' => $_SESSION['cart']->attributes_price_onetime_charges($products[$i]['id'], $products[$i]['quantity']),
'weight' => $products[$i]['weight'],
'products_priced_by_attribute' => $products[$i]['products_priced_by_attribute'],
--
1.7.10.4
Edit
Our CI server just returned results, and the patch above does not seem to break our current tests.
Thats not to say it doesn't break something we are not testing for though :)
Bookmarks