Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
abcisme
... Tax doesn't seem to be recalculating at all. I've tried clicking update...
The installed and enabled order total module(s) calculate tax (not Edit Orders). Let me repeat, Edit Orders does not calculate the order totals (such as subtotal, coupons, discounts, tax, or total). Edit Orders does load and run the installed and enabled order total modules against every order (same as the stock Zen Cart customer checkout process). The order total amounts are calculated by the installed order total modules (if there is an editable text input field they will be overridden by the contents of the field - which can cause some tax related errors for modules "recalculating tax" if they are changed and the order total module is ignorant of the value saved in the database).
Not all order total modules play well when loaded and run from the Zen Cart administrative interface. I see you have multiple non-stock Zen Cart order total modules installed. Are you using the latest versions of all order total modules (and ones compatible with Zen Cart 1.5.3)? What are the exact versions of the installed order total modules (include link and version numbers)? Which order total modules are being used on the order where problems are experienced? Was anything "edited" in the order (and what was edited)?
In order to help us better help you, we will need to know how to duplicate the issue. I have a better idea after your last post, but more specifics would be good (including store, customer, order total module, tax, and other related information and settings). When answering please use code tags to wrap long answers (such as settings and file contents). These can be added by clicking the "#" when replying (should look like: [CODE]long list of settings or contents of a file[/CODE]).
You may wish to enable the "debug log" at "TOTALS". These logs may give us some additional insight as to where things may be getting off track.
Note: As time permits, I try to provide help for reported issues when able to duplicate the issue in a stock Zen Cart installation. This is basically "volunteer" time (my day job takes precedence), so please be patient as it may take awhile before an answer is posted. Just a note for anyone reading this post, I no longer provide troubleshooting services for free against heavily modified Zen Cart installations or databases.
Re: Edit Orders v4.0 Support Thread
What I can't understand is that the orders are coming through with correct totals. It's only after being edited that the totals become incorrect. If it were due to an order total module, wouldn't the orders be calculated incorrectly at checkout?
I just upgraded this site to 1.5.3. All the order total modules are the newest versions.
The particular order in question had a coupon and a group discount only. When I edited the order to remove an item, the total was no longer correct.
I am not sure how to enable the debug log at totals. Could you provide instructions?
Re: Edit Orders v4.0 Support Thread
An example with a test order that I just did and documented my exact steps.
Submitted this order:
1 x ITEM = CDN $6.41
1 x ITEM = CDN $5.80
10 x ITEM = CDN $52.70
Sub-Total: CDN $64.91
Discount Coupon: -CDN $10.00
Account Holder Discount - 3%: -CDN $1.65
Fedex Ground: CDN $10.98
13% Tax (ON): CDN $8.35
Total: CDN $72.59
All order totals correct as submitted by cart.
Clicked the edit button.
Changed tax and unit price on first item to 0.
Selected “no email”, then clicked update button.
Totals get changed to:
Sub-Total: CDN $58.50
Discount Coupon: -CDN $10.00
Account Holder Discount - 3%:
Fedex Ground: -CDN $1.46
13% Tax (ON): CDN $7.54
Total: CDN $65.33
Everything is correct EXCEPT the order total which should be $65.57.
This is what I can't understand.
(Edited to add, just confirmed same thing happens if I remove an item from the order instead of zeroing out the tax and price.)
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
abcisme
What I can't understand is that the orders are coming through with correct totals. It's only after being edited that the totals become incorrect. If it were due to an order total module, wouldn't the orders be calculated incorrectly at checkout? ...
In a perfect world, yes. In reality, not always.
One case (less common now than a few years ago) is when an order total module is bundled with other required changes to the Zen Cart core. Often the author did not expect the order total module to be loaded from the Zen Cart admin... And therefore the author did not include the same modifications to the Zen Cart admin files...
Another (more common) scenario is when you "edit an order", all data in every text input is sent. This data is then used to "override" the values calculated by the order total modules. So basically, any order total with a text input field is recalculated (and does any magic manipulation of the order in the session)... And subsequently the final amount is "overridden" with the value in the text input field.
This is part of why I've been slowly working towards removing the text input fields (which also stops people from being able to edit the value). Balancing the ability to edit those values versus recalculation is a fine line to walk (and also results in quite a few irate PMs). But in the long run, hopefully the changes will make most people's lives easier.
Quote:
Originally Posted by
abcisme
... I just upgraded this site to 1.5.3. All the order total modules are the newest versions. ...
So they are all order total modules included with Zen Cart 1.5.3 and "stock" (unmodified)? If so this will make debugging a little simpler :smile: Otherwise please provide links and exact version numbers for any order totals not included with Zen Cart 1.5.3.
Quote:
Originally Posted by
abcisme
... I am not sure how to enable the debug log at totals. Could you provide instructions?
Log into your Zen Cart administrative interface. Navigate to "Configuration" -> "Edit Orders". There should be an option "Debug Action Level". Set this to "TOTALS". It will create logs specific to Edit Orders in your Zen Cart logs folder.
If you decide to post these, make sure you wrap the log contents with CODE tags.
Quote:
Originally Posted by
abcisme
An example with a test order that I just did and documented my exact steps. ...
Thank You! I'll take a look as soon as I get some free time.
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
So they are all order total modules included with Zen Cart 1.5.3 and "stock" (unmodified)? If so this will make debugging a little simpler :smile: Otherwise please provide links and exact version numbers for any order totals not included with Zen Cart 1.5.3.
Stock ZC 1.5.3 (I uploaded again just to be sure)
Better Together Version 2.5.1
Combination Discounts Version 1.0.9
Here is my update log:
Code:
============================================================
= Edit Orders (4.1.4) Action Log
============================================================
Order ID: 43319
Action Requested: update_order
Enabled Order Totals: ot_subtotal;ot_coupon;ot_group_pricing;ot_shipping;ot_insurance;ot_tax;ot_gv;ot_total
Order Subtotal: 58.5000
Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $7.54',
'class' => 'ot_tax',
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $65.33',
'class' => 'ot_total',
),
)
Order Tax (total): 7.54
Order Tax Groups:
array (
'13% Tax (ON)' => 7.605,
)
Requested Products:
array (
322543 =>
array (
'qty' => '1',
'name' => 'Hydrolyzed Oat Protein',
'onetime_charges' => '0.0000',
'attr' =>
array (
8 =>
array (
'value' => '6095',
'type' => '0',
),
),
'model' => 'LI-HOP',
'tax' => '13',
'final_price' => '5.80',
),
322544 =>
array (
'qty' => '10',
'name' => 'Hydrolyzed Silk Powder',
'onetime_charges' => '0.0000',
'attr' =>
array (
9 =>
array (
'value' => '7174',
'type' => '0',
),
),
'model' => 'CO-HSP',
'tax' => '13',
'final_price' => '5.27',
),
)
============================================================
= Processing Requested Updates to Products
============================================================
Old Order Subtotal: 58.5000
Old Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $7.54',
'class' => 'ot_tax',
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $65.33',
'class' => 'ot_total',
),
)
Old Tax (total): 7.54
Old Tax Groups:
array (
'13% Tax (ON)' => 7.605,
)
Removed Product Order Subtotal: 52.7
Removed Product Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $52.70',
'class' => 'ot_subtotal',
'value' => 52.7,
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $6.79',
'class' => 'ot_tax',
'value' => 6.786,
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $70.47',
'class' => 'ot_total',
'value' => 70.466,
),
)
Removed Product Tax (total): 6.786
Removed Product Tax Groups:
array (
'13% Tax (ON)' => 6.851,
)
Added Product Order Subtotal: 58.5
Added Product Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
'value' => 58.5,
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $7.54',
'class' => 'ot_tax',
'value' => 7.54,
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $77.02',
'class' => 'ot_total',
'value' => 77.02,
),
)
Added Product Tax (total): 7.54
Added Product Tax Groups:
array (
'13% Tax (ON)' => 7.605,
)
Old Order Subtotal: 58.5
Old Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
'value' => 58.5,
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $7.54',
'class' => 'ot_tax',
'value' => 7.54,
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $77.02',
'class' => 'ot_total',
'value' => 77.02,
),
)
Old Tax (total): 7.54
Old Tax Groups:
array (
'13% Tax (ON)' => 7.605,
)
Removed Product Order Subtotal: 5.8
Removed Product Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $5.80',
'class' => 'ot_subtotal',
'value' => 5.8,
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $0.69',
'class' => 'ot_tax',
'value' => 0.689,
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $17.47',
'class' => 'ot_total',
'value' => 17.469,
),
)
Removed Product Tax (total): 0.689
Removed Product Tax Groups:
array (
'13% Tax (ON)' => 0.754,
)
Added Product Order Subtotal: 58.5
Added Product Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
'value' => 58.5,
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $7.54',
'class' => 'ot_tax',
'value' => 7.54,
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $77.02',
'class' => 'ot_total',
'value' => 77.02,
),
)
Added Product Tax (total): 7.54
Added Product Tax Groups:
array (
'13% Tax (ON)' => 7.605,
)
Updated Products Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.76',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $8.80',
'class' => 'ot_tax',
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $75.03',
'class' => 'ot_total',
),
)
Updated Products Tax (total): 8.80
Updated Products Tax Groups:
array (
'13% Tax (ON)' => 7.605,
)
Requested Order Totals:
array (
0 =>
array (
'code' => 'ot_coupon',
'title' => 'Discount Coupon: abcisme :',
'value' => '10.0000',
),
1 =>
array (
'code' => 'ot_group_pricing',
'title' => 'Group Discount:',
'value' => '1.4600',
),
2 =>
array (
'code' => 'ot_shipping',
'shipping_module' => 'fedexwebservices',
'title' => 'Fedex Ground:',
'value' => '10.9800',
),
3 =>
array (
'code' => 'ot_insurance',
'title' => '',
'value' => '',
'shipping_module' => '',
),
)
============================================================
= Processing Requested Updates to Order Totals
============================================================
Starting Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon: abcisme :</a>',
'text' => '-CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => '-CDN $1.76',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $8.80',
'class' => 'ot_tax',
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $75.03',
'class' => 'ot_total',
),
)
Starting Tax (total): 8.80
Starting Tax Groups:
array (
'13% Tax (ON)' => 7.605,
)
Updated Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon</a>',
'text' => 'CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => 'CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $8.80',
'class' => 'ot_tax',
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $75.03',
'class' => 'ot_total',
),
)
Updated Tax (total): 7.31027224742
Updated Tax Groups:
array (
'13% Tax (ON)' => 7.54027224742,
)
============================================================
= Done Processing Requested Updates to the Order
============================================================
Final Subtotal: 58.5000
Final Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => 'CDN $58.50',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => '<a href="javascript:couponpopupWindow(\'REMOVED\')">Discount Coupon</a>',
'text' => 'CDN $10.00',
'class' => 'ot_coupon',
),
2 =>
array (
'title' => 'Group Discount:',
'text' => 'CDN $1.46',
'class' => 'ot_group_pricing',
),
3 =>
array (
'title' => 'Fedex Ground:',
'text' => 'CDN $10.98',
'class' => 'ot_shipping',
),
4 =>
array (
'title' => '13% Tax (ON):',
'text' => 'CDN $8.80',
'class' => 'ot_tax',
),
5 =>
array (
'title' => 'Total:',
'text' => 'CDN $75.03',
'class' => 'ot_total',
),
)
Final Tax (total): 7.31027224742
Final Tax Groups:
array (
'13% Tax (ON)' => 7.54027224742,
)
Re: Edit Orders v4.0 Support Thread
Forgot one: Optional Shipping Insurance @version $Id: ot_insurance.php 12 2011-09-17 00:26:13Z numinix $
Just tried updating to 3.2.2, but when I tried to edit an order, it added the insurance no matter what I did. I could not remove the insurance.
ETA. When I uninstalled/removed the module, I still had the order total miscalculation issue.
Also removed better together and combination discounts, just to check if it was those and nope..
Re: Edit Orders v4.0 Support Thread
Another clue perhaps? If I move the group discount just before the total, the total becomes correct, but the tax is then incorrect.
Re: Edit Orders v4.0 Support Thread
When I put the group discount before the coupon discount, the line items add up correctly, but the tax is 2 cents too low and then the total is 3 cents too low. Again, this only happens when editing an order. The totals are calculating correctly through checkout.
Sub-Total: CDN $58.50
Account Holder Discount - 3%: -CDN $1.76
Discount Coupon: -CDN $10.00
Shipping: $10.98
13% Tax (ON): CDN $7.48
Total: CDN $65.20
Should be:
$58.50
$(1.76)
$(10.00)
$10.98
$7.50
$65.23
Re: Edit Orders v4.0 Support Thread
Just set up a completely vanilla version of zc153.
Installed Edit Orders 4.1.4 ONLY.
Created one tax zone - Ontario 13%.
Did not install ANY shipping modules.
Did not install ANY order total modules.
Did not change sort order of order total modules.
Did not change setup of any order total modules.
Placed an order:
1 x Matrox G200 MMS (MG200MMS) = $100.00
Model Value
Memory 4 mb
Sub-Total: $100.00
Flat Rate (Best Way): $5.00
Discount Coupon: test : -$10.00
Group Discount: -$9.00
Ontario: $10.53
Total: $96.53
Clicked Edit Order. Did not make any changes. Clicked update order button.
Order total changed:
Sub-Total: $100.00
Flat Rate (Best Way): $5.00
Discount Coupon: test : -$10.00
Group Discount: -$9.00
Ontario: $10.53
Total: $95.23
Re: Edit Orders v4.0 Support Thread
If you disable the "group discount" module what happens?