Same issue as is described here:
http://www.zen-cart.com/forum/showthread.php?t=120341
but for coupons instead of group pricing.
Fixes described by Wilt work correctly (of course, update ot_coupon.php instead of ot_group_pricing).
Same issue as is described here:
http://www.zen-cart.com/forum/showthread.php?t=120341
but for coupons instead of group pricing.
Fixes described by Wilt work correctly (of course, update ot_coupon.php instead of ot_group_pricing).
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Great work Scott (and thanks also to Wilt)
I'm going to consolidate the list of fixes to a single post to make it easier on people:
a) Edit includes/classes/order.php
circa line 347 - you should see
which should be changed toPHP Code:
'subtotal' => 0,
'tax' => 0,
'total' => 0,
b) edit includes/modules.order_total/ot_shipping.phpPHP Code:
'subtotal' => 0,
'shipping_tax'=>0,
'tax' => 0,
'total' => 0,
circa line 67 change
toPHP Code:
$order->info['tax'] += $shipping_tax_amount;
$order->info['tax_groups']["$shipping_tax_description"] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
c) For the original group pricing fix, edit includes/modules/order_total/ot_group_pricing.phpPHP Code:
$order->info['tax'] += $shipping_tax_amount;
$order->info['shipping_tax'] += $shipping_tax_amount;
$order->info['tax_groups']["$shipping_tax_description"] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
circa line 60
change
toPHP Code:
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
d) For the coupon fix, edit includes/modules/order_total/ot_coupon.phpPHP Code:
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
if ($this->include_shipping != 'true') $order_total_tax -= $order->info['shipping_tax'];
if ($this->include_tax != "true" && $this->include_shipping != 'true') $order_total += $order->info['shipping_tax'];
circa line 396
change
toPHP Code:
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
PHP Code:
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
if ($this->include_shipping != 'true') $order_total_tax -= $order->info['shipping_tax'];
if ($this->include_tax != "true" && $this->include_shipping != 'true') $order_total += $order->info['shipping_tax'];
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Will this fix work for stores with tax not included in pricing?
I didn't know there was a problem for stores which don't have tax included in pricing - have you verified this?
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
It's doing to same thing with my store; the coupon is discounting the coupon % from the shipping amount even though it is set to the following in the order total module:
Discount Coupon (Sort Order 280) (Settings are:false, false, standard)
Shipping (Sort Order 290)
Sub-Total (100)
Tax (300)
Total(999)
Display prices with tax: false
This is a sample of how it is currently calculating:
Subtotal: $42.00 (correct)
Coupon (20% off): $-8.40 (correct 42.00 * 20%)
Shipping: $8.95 (correct 20% is not being removed)
8% PST: $3.26 (incorrect should be $3.40 see below)
5% GST: $2.04 (incorrect should be $2.13 see below)
Total: $47.85 (incorrect should be $48.08)
The taxes are being calculated as if there is 20% off shipping:
42.00 - 20% = 33.60 (correct)
8.95 - 20% = $7.16 (incorrect, should not discount shipping)
33.60 + 7.16 = 40.76 (incorrect)
40.76 * 8% = 3.26 (incorrect)
40.76 * 5% = 2.04 (incorrect)
I would really appreciate any assistance you may be able to offer me as I am really struggling on this one.
Bookmarks