-
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?
-
Re: Edit Orders v4.0 Support Thread
Removed group discount from order total modules.
Clicked edit order.
Clicked Update button.
Order totals appear as:
Group Discount: $9.00
Sub-Total: $100.00
Discount Coupon: -$10.00
Ontario: $11.70
Total: $106.70
-
Re: Edit Orders v4.0 Support Thread
Please make a new order with group discount disabled to test.
-
Re: Edit Orders v4.0 Support Thread
Sub-Total: $100.00
Flat Rate (Best Way): $5.00
Discount Coupon: test : $10.00
Ontario: $11.70
Total: $106.70
Clicked edit. Clicked update. Order total is correct.
Sub-Total: $100.00
Flat Rate (Best Way): $5.00
Discount Coupon: test : $10.00
Ontario: $11.70
Total: $106.70
-
Re: Edit Orders v4.0 Support Thread
Thank you for confirming my suspicion. I have a few guesses as to the cause, but will need time to investigate further in order to determine the cause and best fix.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Thank you for confirming my suspicion. I have a few guesses as to the cause, but will need time to investigate further in order to determine the cause and best fix.
Thank you SO much. I really appreciate you taking the time to figure it out!
-
Re: Edit Orders v4.0 Support Thread
In case this gives you more info, when I have the group discount enabled, but there is no tax on the order, the total is correct. So it must have something to do with the tax calculations when using a group discount.
-
Re: Edit Orders v4.0 Support Thread
I got edit orders upgraded on a site that I upgraded from 1.3.9 to 1.5.4
Another site upgrading from 1.5.1 to 1.5.4, I'm getting an error when trying to edit an order:
[21-Mar-2015 10:54:44 America/Los_Angeles] PHP Warning: include_once(includes/modules/shipping/usps.php): failed to open stream: No such file or directory in /home/user/public_html/includes/classes/shipping.php on line 58
[21-Mar-2015 10:54:44 America/Los_Angeles] PHP Warning: include_once(): Failed opening 'includes/modules/shipping/usps.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/includes/classes/shipping.php on line 58
[21-Mar-2015 10:54:44 America/Los_Angeles] PHP Fatal error: Class 'usps' not found in /home/user/public_html/includes/classes/shipping.php on line 59
There are several other shipping methods but they aren't throwing an error. I know I'm getting really tired but I just can't see what I've missed. Would there be something special about USPS?
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
delia
...I'm getting an error when trying to edit an order:
[21-Mar-2015 10:54:44 America/Los_Angeles] PHP Warning: include_once(includes/modules/shipping/usps.php): failed to open stream: No such file or directory in /home/user/public_html/includes/classes/shipping.php on line 58
...
Appears during the upgrade of Zen Cart from 1.5.1 to 1.5.4 the file "/includes/classes/shipping.php" was replaced with a copy from Zen Cart 1.5.4. This file (among others) requires modification for Edit Orders to work. Please re-install Edit Orders (and double check all "modified code files").
-
Re: Edit Orders v4.0 Support Thread
This was working yesterday until I installed another mod and overwrote the orders.php file in admin. I had put the changes into the classes / shipping.php.
Actually after trying to get something that works, I now have another error - not on edit_orders.php but on orders.php. As it's a error I've never seen before and it happens no matter what orders.php version I upload, I don't think it's connected to the edit orders mod. There's now something really screwy going on - That post on that error is here.
I'm beginning to think I'm cursed......
-
2 Attachment(s)
Re: Edit Orders v4.0 Support Thread
Hi all,
i've installed a new zen cart 1.5.4 and add the Edit Order module along with Rewar point, again :P. It works well except for one little thing, here two images to explai it simly:
Here before i modified the order:
Attachment 15114
Here after the edit.
Attachment 15115
The last line "Punti guadagnati" (Earned Reward Points) got the € symbol even if i completely ignore that field (i just modified from 3 to 5 the shipping cost).
Is there a way to avoid this?
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
izar74
Hi all,
i've installed a new zen cart 1.5.4 and add the Edit Order module along with Rewar point, again :P. It works well except for one little thing, here two images to explai it simly:
Here before i modified the order:
Attachment 15114
Here after the edit.
Attachment 15115
The last line "
Punti guadagnati" (Earned Reward Points) got the
€ symbol even if i completely ignore that field (i just modified from 3 to 5 the shipping cost).
Is there a way to avoid this?
It's a known issue with Rewards Points.. I think there is a fix for this posted on the Rewards Points support thread.. not really an Edit Orders issue..
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
DivaVocals
It's a known issue with Rewards Points.. I think there is a fix for this posted on the Rewards Points support thread.. not really an Edit Orders issue..
Hi Diva :P,
i found the culprit, in \admin\edit_orders.php line 432 is:
PHP Code:
$order_total['text'] = $currencies->format($order_total['value'], true, $order->info['currency'], $order->info['currency_value']);
tell me if i get it right, basically It take the order_total['value'] and put it in the order_total['text'] after formatting it with currencies.
Would something like
PHP Code:
$order_total['text'] = $order_total['value'];
do the same but without formatting?
Thanks
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
izar74
Hi Diva :P,
i found the culprit, in \admin\edit_orders.php line 432 is:
PHP Code:
$order_total['text'] = $currencies->format($order_total['value'], true, $order->info['currency'], $order->info['currency_value']);
tell me if i get it right, basically It take the order_total['value'] and put it in the order_total['text'] after formatting it with currencies.
Would something like
PHP Code:
$order_total['text'] = $order_total['value'];
do the same but without formatting?
Thanks
Nope.. The fix would NOT be in the \admin\edit_orders.php file at all.. because like I said.. It's not an Edit Orders issue.. It's a Rewards Points issue..
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
DivaVocals
Nope.. The fix would NOT be in the \admin\edit_orders.php file at all.. because like I said.. It's not an Edit Orders issue.. It's a Rewards Points issue..
Sorry Diva, maybe i'm a little odd buy i cannot understand how this error could be related to Reward Point... It ěs generated when i edit an order using Edit order...
Maybe I explained bad..
1. I put ad order
2. I went to admin and edited the order using Edit order to change the shipping price
3. After udating i saw that in the field of the points there was a "€" more" , added by the editing. Checking the database i found that the Value field was unchanged, but the TEXT field had a "€" (i'm referring to the order_total table in the database).
The thing that i'm traying to say is that the Reward point module is not involved after i put the order, all the admin part regards the edit order module. It is the Edit Order module that Edit the fields and modified it... or my logic is wrong?
By the way thanks for the advice
-
Re: Edit Orders v4.0 Support Thread
The issue you are reporting is caused by the way Reward Points was implemented. This is not a bug in Edit Orders.
There is a long dicsussion about the issue in the Reward Points thread. The discussion includes known workarounds (and the issues introduced by the workarounds). The discussion also includes the WHY and suggestions for improving / refactoring a future version of Reward Points.
Further discussion on the topic of Reward Points should occur in the Reward Points support thread.
-
Re: Edit Orders v4.0 Support Thread
The site I manage has a lot of call for price products. We've begun to input the orders with the Edit Orders/Super Orders modules. I see from the support thread that these modules don't actually process the credit cards. Is it possible to make this happen (we use usaepay for credit card processing)? Any help would be appriciated.
Thanks,
Tadj
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
Tadj Hemingway
The site I manage has a lot of call for price products. We've begun to input the orders with the Edit Orders/Super Orders modules. I see from the support thread that these modules don't actually process the credit cards. Is it possible to make this happen (we use usaepay for credit card processing)? Any help would be appriciated.
Thanks,
Tadj
You will need custom code to process credit cards from the back end.. not likely that anyone will do this development for free..
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Thank you for confirming my suspicion. I have a few guesses as to the cause, but will need time to investigate further in order to determine the cause and best fix.
Have you had a chance to make any progress on the fix for this?
-
Re: Edit Orders v4.0 Support Thread
Since I can't get the calculations to work right with EO 4.1.4, I uninstalled and installed EO 4.0.4. When I load the edit orders page, I'm getting "Failed to connect database:opai" at the advanced attributes editor. Anyone have any idea why this would happen?
-
Re: Edit Orders v4.0 Support Thread
Edit Orders 4.0.x is not compatible with Zen Cart >= 1.5.2.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Edit Orders 4.0.x is not compatible with Zen Cart >= 1.5.2.
Ugh... Bummer. I am desperate for a solution to the miscalculation errors in EO 4.1.4.
-
Re: Edit Orders v4.0 Support Thread
I have zen cart 1.5.0 with edit orders 4.1 installed. I also have isbn/upc fields installed. When i attempt to edit a customer order i get the following error on the top in the admin window (There was a problem retrieving transaction details. ) the associated log file contains: [14-Apr-2015 22:27:53 America/Chicago] PHP Fatal error: 1054:Unknown column 'p.products_quantity' in 'field list' :: SELECT `p`.`products_quantity` FROM `zen_products` WHERE `p`.`products_id` = '19492' in /home4/pitstopc/public_html/store/includes/classes/db/mysql/query_factory.php on line 120.
I have tried to resolve it by uninstalling the add-on and reinstalling it without any success. I have the feeling I put a file in the wrong place and in the right place. so it is creating this problem.
Any ideas?
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
0ldgeezer
I have zen cart 1.5.0 with edit orders 4.1 installed. ... the log file contains: [14-Apr-2015 22:27:53 America/Chicago] PHP Fatal error: 1054:Unknown column 'p.products_quantity' in 'field list' :: SELECT `p`.`products_quantity` FROM `zen_products` WHERE `p`.`products_id` = '19492' in /home4/pitstopc/public_html/store/includes/classes/db/mysql/query_factory.php on line 120. ...
Please follow the instructions in the posted fix to resolve this error message.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Please follow the instructions in the
posted fix to resolve this error message.
I tried the fix that was listed and it changed the results a bit. Now I get a blank white screen when i attempt to update an order and no longer get a generated logfile. So after waiting a few moments I go back to the original screen and there is no error at the top either. Still no joy in being able to update an order.
I have even gone as far as upgrading from zencart 1.5.1 to 1.5.4 and upgraded my database accordingly. Didn't seem to make a difference. So i started over from scratch and still have the problem carried over.
I appreciate your help with this, I am getting slightly over cooked.
-
Re: Edit Orders v4.0 Support Thread
Should be a log file if you see a "white screen" when clicking "update" (if using FTP to access the logs be sure to clear any cache in your FTP client).
If you are seeing a white screen when trying to access "/admin/edit_orders.php" it could indicate something not quite merged correctly (or a bad upload)... Could also be a number of other things... Are there any errors in the Apache error log?
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Edit Orders 4.0.x is not compatible with Zen Cart >= 1.5.2.
For anyone who has been having the same troubles I was having with group discounts causing calculation errors in 4.1.4, I do now have a copy of 4.0.4 that will work on ZC 1.5.3. At least now I can edit my orders in the admin panel, rather than having to go directly into the database.
-
Re: Edit Orders v4.0 Support Thread
Thanks for the resolution. I hadn't thought of updating my other plug-ins. lhungil, Thank you..
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
geezerly
Thanks for the resolution. I hadn't thought of updating my other plug-ins. lhungil, Thank you..
No problem. For other people who may stumble across these posts in the future, after the posted fix was applied additional error logs were identified. The logs indicated an older version of a 3rd party "Order Total" module was installed. Updating the "Order Total" module appears to have resolved the "white screen".
Were there any other changes / fixes needed geezerly?
-
1 Attachment(s)
Re: Edit Orders v4.0 Support Thread
Hello,
I have a problem with the Edit Orders 4.1.4 plugin (Zencart 1.5.0). Prices of products, taxes and shipping charge are calculated correctly, but the edit doesn't consider additional prices (e.g. insured shipment or cash on delivery ). How can I solve this problem?
Thank you in advance for your reply.
Attachment 15242
-
Re: Edit Orders v4.0 Support Thread
Order Total pricing IS NOT calculated by Edit Orders. Your installed Order Total modules are responsible for returning the correct data for Zen Cart to update Order Totals (such as "Totale").
Would suggest taking a look at the two Order Total modules you have installed (Insured Shipment and Cash on Delivery) to determine why they are not working when loaded from the Zen Cart administration interface. Would also suggest checking the Zen Cart debug logs (if any).
-
1 Attachment(s)
Re: Edit Orders v4.0 Support Thread
Hello Lhungil,
unfortunately, I'm still not so familiar with Zencart. Please, can you give me some more details? A have a problem with the price only when I try to change an order. I uploaded an image that shows you the difference of prices when I change "Cash on Delivery" from 7,9981 to 8,9981 (the same thing changing Insured Shipping). I think the field "ot_cod_fee" is not calculated. I also noticed that Zen Cart properly calculates the order without Edit order. If you need, I can attach the "log" created by edit orders.
Thank you for your reply.
Attachment 15247
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
JDanielsita
Hello Lhungil,
unfortunately, I'm still not so familiar with Zencart. Please, can you give me some more details? A have a problem with the price only when I try to change an order. I uploaded an image that shows you the difference of prices when I change "Cash on Delivery" from 7,9981 to 8,9981 (the same thing changing Insured Shipping). I think the field "ot_cod_fee" is not calculated. I also noticed that Zen Cart properly calculates the order without Edit order. If you need, I can attach the "log" created by edit orders.
Thank you for your reply.
Attachment 15247
lhungil has already answered your question, but let me try and re-phrasing it.
The issue is not with Edit Orders, the issue is with the Insured Shipment and Cash on Delivery order total modules.
Insured Shipment and Cash on Delivery are not correctly re-calculating the COD or Insured Shipment totals when you edit the order using Edit Orders.
Again.. This is not an issue with Edit Orders, this is an issue with your two order total modules (Insured Shipment and Cash on Delivery
Installed order total modules are responsible for returning the correct data when an order is edited. Insured Shipment and Cash on Delivery are not working when loaded from the Zen Cart administration interface, and therefore they will not work with Edit Orders. Do you have any related Zen Cart logs? If so you should post them..
-
Re: Edit Orders v4.0 Support Thread
It seems as though when the values for non-built-in order totals are updated, the changes are not reflected in the final cart total - are the values which are entered on the screen not used? It looks like the order total module in question are rerun and those values are used. The fields in the orders_total show my edit updates but the final total doesn't match.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
swguy
It seems as though when the values for non-built-in order totals are updated, the changes are not reflected in the final cart total - are the values which are entered on the screen not used? It looks like the order total module in question are rerun and those values are used. The fields in the orders_total show my edit updates but the final total doesn't match.
Changes to the order total are calculated by individual Order Total Modules (and displayed / stored in the database by "ot_total"), not Edit Orders. This means when a third party Order Total module fails to return valid data or update $order->info['total'] as needed... The total for the order will not be updated.
The most common cause of issues reported regarding the total not being correct are Order Total modules not designed as "Standalone", but instead depending upon other modifications to the Zen Cart store front. The modifications needed to Zen Cart administrative interface (for these modules to work) are often not provided to end users. Edit Orders is an administrative tool (run from the Zen Cart administrative interface), so when run these third party Order Total modules do not function as expected or in some cases outright crash.
Another common cause is the third party Order Total module always recalculating (and not using the value from the database). Currently this can be addressed by the third party order total looking at the Global variable $order->totals at the start of the Order Total module's "process" function (or checking the database manually). When the value has been altered via Edit Orders, the altered value will be present (while the "process" function is being called).
There are some changes coming in the next version of Edit Orders (which may help some). This includes a reworked responsive interface, automatic removal of Order Total modules not returning a value when run, fields can be togged between "editable" or "automatically calculated", utilization of the additional PCI Compliance structures added in Zen Cart 1.5.4+ (when run under Zen Cart 1.5.4+), additional notifiers, an installer capable of merging required core files automatically during installation, and more. There is no ETA for the next release at this time.
Abbreviated list of steps in the Current Process (in regards to order totals):
- User edit's Order Total value / name.
- User clicks "update".
- The Mock Shopping cart is loaded (reads data from $order - not fully implemented at this time).
- Some verification, validation, and sanitization is performed.
- Order, Order Status, Order Status History, Order Totals, etc are loaded from the database.
- Global and Session variables are populated (to match the shopping_cart page).
- Some special handling is applied based on DISPLAY_PRICE_WITH_TAX.
- Order Total modules are run (and the result saved in the Global and Session variables).
- Any Order Total modules not returning a value are removed from the Global and Session variables (Edit Orders 4.1.5+; not yet released).
- Order Total values in the database are updated (from the Global and Session variables).
- User's Order Total value / name in the Global and Session variables are updated (or added if not present).
- The Order Total information in the database is updated from the Global and Session variables.
- The order is reloaded (from the database).
- The Order Total modules are run again (so they can apply any changes and to allow ot_subtotal, ot_tax, ot_coupon, and ot_total to recalculate).
- Any Order Total modules not returning a value are removed from the Global and Session variables (Edit Orders 4.1.5+; not yet released).
- Order Total values in the database are updated (from the Global and Session variables).
- The Edit Orders page is reloaded (to display the updated order).
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Changes to the order total are calculated by individual Order Total Modules (and displayed / stored in the database by "ot_total"), not Edit Orders. This means when a third party Order Total module fails to return valid data or update $order->info['total'] as needed... The total for the order will not be updated.
What I'm asking for is: if I update the value of the order total dollar amount, can you use this instead of using what the OT Module returns? Like an override capability.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
swguy
What I'm asking for is: if I update the value of the order total dollar amount, can you use this instead of using what the OT Module returns? Like an override capability.
Some thoughts based on this question... Feel free to add to the list...
Stop relying on the Order Total modules and have Edit Orders do the math?
The answer is no.
Doing so would be going backwards to the way Edit Orders 4.0.x operated.
Edit Orders 4.0.x did it's own math, calculations, etc (to allow overrides)... Order Total Modules were not loaded (and the code completely ignored including: settings, tax handling, and other behaviors)... The value (dollar amount) of order totals were always "added" (resulting in third party "discount" modules adding to the total instead of subtracting)... And in general leading to admin users needing to double check everything or risk wrong pricing (and the wrath of upset customers).
Product and attribute pricing was manually calculated instead of using the existing Zen Cart code (and some of the calculation rules were ignored). When adding a product to an existing order, the pricing did not always match the price shown to customers on the website. Again forcing admin users to spend valuable time double check everything or risk wrong pricing (and the wrath of upset customers).
Invalid data was sometimes injected into the database relating to orders (adding shipping to an existing order always failed to result in correctly normalized data). This could cause issues with core portions of Zen Cart as well as third party modules and code (for example code synchronization with other inventory / accounting software).
I'd be surprised if there were not other issues as well, but those are the ones I remember (off the top of my head).
End users manually override the value (dollar amount) of third party order totals?
The problem is: the Order Total system in Zen Cart was not designed to allow end users to "override" dollar amounts (and the API does not include methods to allow overrides). As such, 90% of the Order Totals are not written to take into account they may be overridden.
So if we want to allow overriding the value (dollar amount) of an order total... Until all third party Order Total modules are coded to check for and use an override (and adjust $order->info as appropriate)... Problems with the "Total" (ot_total) and "Tax" (ot_tax) will ensue.
I've thought about adding a "Mock Order Total Module" to better support overriding the value (dollar amount) of an order total... But at a glance I forsee problems with this approach... For example: how does the mock know how tax should be handled? How does the mock know when to add to total vs. subtract from total?
Another thought was to disable editing / overriding the value (dollar amount) of an order total unless the module defines a public variable such as "$override_allowed" (and implements the necessary functionality)... Ugly, but could lead into being added to the core API, so a potential route...
The above are some (of the many reasons) I've been tempted many times to switch Edit Orders 4.1.x back to "automatic calculation only" (no overrides allowed) for all order total modules... Prior to the first public release this was added back in due to OVERWHELMING DEMAND by alpha test participants (along with special handling for most of the "core" order total modules included with Zen Cart).
End user to manually override the value (dollar amount) of all order totals?
I am planning to add this functionality into a future release. Once certain items are overridden, the user will be forced to manually override "Tax" (ot_tax) and "Total" (ot_total). This should help by allowing people to manually update the values.
Long term, I suspect it would be better to just enforce "automatic calculations only" for the value (dollar amount) of all order totals. Or make changes to the Zen Cart API and the core Zen Cart code handling orders and order totals.
-
Re: Edit Orders v4.0 Support Thread
Other thoughts
Long term, I believe it would be beneficial to refactor the existing Zen Cart code handling pricing, the shopping cart, orders, and order processing. Perhaps creating an API and smaller classes separating handling of the database domain, business logic, and display logic. Sprinkle in plenty of notifier hooks and abstraction (and smaller methods to enable better code reuse).
Wish I had more time to start down this path (or help walk down this path).
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
End user to manually override the value (dollar amount) of all order totals?
I am planning to add this functionality into a future release. Once certain items are overridden, the user will be forced to manually override "Tax" (ot_tax) and "Total" (ot_total). This should help by allowing people to manually update the values.
Totally fair. Your gun, your bullet, your foot. :)
In the mean time, it might make sense to make those figures NOT editable since editing the values doesn't really work. (You can edit the labels, just not the values.)
-
Re: Edit Orders v4.0 Support Thread
Fair enough (gun smithing in process).
Will be a fair amount of work, so perhaps it would not be a bad idea to just disable the fields for third party modules (most of the stock Zen Cart OT modules can be successfully edited).
Just to be clear (to everyone), there is no ETA for the changes we have been discussing.
-
Re: Edit Orders v4.0 Support Thread
Hi
Just a quick note for anyone having the same problem as I did today. Hopefully this may save someone from much unnecessary stress.
In summary: a blank page after install without error messages in the log.
For you information, I have successfully installed this module about three times before this 'interesting' experience today, and can assure anybody thinking about Edit Orders that it is a 'Must Have' module!.
I have zc 1.5.4 installed (I successfully updated a 1.3.9 database). I had successfully installed several plugins and mods, but none overwrote any of the core files in Edit Orders 4.1.4. After logging into Admin, I then uploaded the install files as in the directions. When I went back to Admin and clicked a link the page went blank. There were no success or failure messages. Also, when checking the log files, none were created.
After much searching of this thread and after three re-installs I experimented. I removed the two install files from the server. I then clicked on Admin and the 'Admin Log In' page came up! I successfully logged in and Edit Orders was available. When updating an order I received the error message, and there was an error message in the log this time. So, I edited the edit_orders_functions.php file as in this post within this thread.
Tested and all appears to now be working!
Would appreciate if anyone can tell me why this happened though.
-
Re: Edit Orders v4.0 Support Thread
If you deleted the init_scripts, you disabled the installer... And the installation may not be complete... DO NOT disable / delete the init_scripts unless instructed to do so by the installer.
Usual cause of all admin pages blank after uploading the install init_scripts are either a corrupted upload or invalid paths specified in "/admin/includes/configure.php". Most commonly the cause is an invalid / incorrect path.
-
Re: Edit Orders v4.0 Support Thread
Thanks. I will look into that further...
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
If you deleted the init_scripts, you disabled the installer... And the installation may not be complete... DO NOT disable / delete the init_scripts unless instructed to do so by the installer.
Usual cause of all admin pages blank after uploading the install init_scripts are either a corrupted upload or invalid paths specified in "/admin/includes/configure.php". Most commonly the cause is an invalid / incorrect path.
Just did a fresh install of Edit Orders and there was no problem with the install except having to modify the edit_order_functions.php file with the ' AS `p` ' Fix.
Thanks once again for your help with this problem. :smile:
Cheers
Anthony
-
Re: Edit Orders v4.0 Support Thread
I have a client that wants to update orders and create a new invoice at the same time - will this module do that?
Thanks
-
Re: Edit Orders v4.0 Support Thread
Would love to see a feature added,
making adding a coupon post order more simple, now I can add a line when editing however in the database it is not stored as ot_coupon for reporting purposes
-
Re: Edit Orders v4.0 Support Thread
If you select "ot_coupon" and enter the coupon code Edit Orders does add the corresponding entries in the database table (storing order totals). So if the report queries this table, it should work.
Edit Orders does not however update the "# of uses" or other non-order specific coupon entries (at this time)... Which report (3rd party? built-in? steps to access) are you referring to (so I can add the info as a request in the project management system for future review).
-
Edit Orders Final Cost Adjustment
We tend to adjust the shipping charges for our customers whenever possible. With the current version of EO we have to edit a coupon amount and then apply the coupon to the order totals. Is there a way to enter the shipping discount without using the coupon? Thank you.
ZC 1.5.4
OE 4.1.4
-
Re: Edit Orders Final Cost Adjustment
Quote:
Originally Posted by
voltar
We tend to adjust the shipping charges for our customers whenever possible. With the current version of EO we have to edit a coupon amount and then apply the coupon to the order totals. Is there a way to enter the shipping discount without using the coupon? Thank you.
ZC 1.5.4
OE 4.1.4
You should be able to directly change the amount for ot_shipping if desired... Or for reporting purposes (and to make the discount obvious to a customer) or you could clone "ot_onetime_discount" and modify it to fit your needs.
-
Re: Edit Orders v4.0 Support Thread
Hi lhungil,
I have Optional Shipping Insurance with Edit Orders 4.1.4 on ZenCart 1.5.4 and noticed that the Optional Insurance amount was not being included in the order total after editing the order.. I see you comment "returns nothing when loaded in the admin ($charge_it is set to 'false'), so will not recalculate the order total automatically."
Is this the problem I am having?
Do you have any idea how I can fix the problem?
Thanks!!!
Andy
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
Andy_M
Hi lhungil,
I have Optional Shipping Insurance with Edit Orders 4.1.4 on ZenCart 1.5.4 and noticed that the Optional Insurance amount was not being included in the order total after editing the order.. I see you comment "returns nothing when loaded in the admin ($charge_it is set to 'false'), so will not recalculate the order total automatically."
Is this the problem I am having?
Do you have any idea how I can fix the problem?
Thanks!!!
Andy
If it helps.. here is the log that shows the order total is not including the insurance..
Code:
============================================================
= Done Processing Requested Updates to the Order
============================================================
Final Subtotal: 12.5000
Final Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$12.50',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => 'USPS Standard (Shipping to US):',
'text' => '$4.75',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => 'WA TAX 8.4%:',
'text' => '$1.45',
'class' => 'ot_tax',
),
3 =>
array (
'title' => 'Shipping Insurance',
'text' => '$1.70',
'class' => 'ot_insurance',
),
4 =>
array (
'title' => 'Total:',
'text' => '$18.70',
'class' => 'ot_total',
),
)
Final Tax (total): 1.45
Final Tax Groups:
array (
'WA TAX 8.4%' => 1.4490000000000000657252030578092671930789947509765625,
)
-
Re: Edit Orders v4.0 Support Thread
OK..
I think I found a solution to this, in case anyone else has the Optional Shipping Insurance with Edit Orders 4.1.4 and ZenCart 1.5.4..
In the file..
\My_Admin_Folder\edit_orders.php
Near line 437 after ..
Code:
// TODO Special processing for some modules
if(zen_not_null($order_total['title']) && $order_total['title'] != ':') {
switch($order_total['code']) {
I added...
Code:
case 'ot_insurance':
$_SESSION['opt_insurance'] = true;
break;
so the code looks like this now...
Code:
// TODO Special processing for some modules
if(zen_not_null($order_total['title']) && $order_total['title'] != ':') {
switch($order_total['code']) {
case 'ot_insurance':
$_SESSION['opt_insurance'] = true;
break;
case 'ot_shipping':
$GLOBALS['order']->info['shipping_cost'] = $order_total['value'];
$GLOBALS['order']->info['shipping_module_code'] = $order_total['shipping_module'];
break;
case 'ot_tax':
This seems to give the ot_insurance code the variable it needs to add the insurance to the order total correctly.
Let me know if anyone else tries this and has success or problems..
-Andy
-
Re: Edit Orders v4.0 Support Thread
May want to double check to ensure your change does not FORCE insurance on all orders when updated via edit orders (including when saving an order where the customer did not request insurance). The above runs a good likelyhood of also flipping insurance for any subsequent order as you are adding the change into the Store Admin's login session (persists beyond a single admin page / request).
May be better to update ot_insurance.php to check if the module was already part of the order and loaded via admin (and if both are true, flip the flag instead of adding to the session).
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
May want to double check to ensure your change does not FORCE insurance on all orders when updated via edit orders (including when saving an order where the customer did not request insurance). The above runs a good likelyhood of also flipping insurance for any subsequent order as you are adding the change into the Store Admin's login session (persists beyond a single admin page / request).
May be better to update ot_insurance.php to check if the module was already part of the order and loaded via admin (and if both are true, flip the flag instead of adding to the session).
Thanks lhungil,
I was pondering those same possibilities. So far my testing has not produced any problems with unintended application of insurance, both in the Admin Edit Orders or with customers regular shopping cart. I will keep testing, but so far this seems to work for me.
I appreciate your taking time to look at it.
Andy
-
Re: Edit Orders v4.0 Support Thread
Has anyone reported calculation problems with zc 1.5.4 and php 5.5.25? I moved the site from one server to another so no change to the site, just the new php version. On an order with about 40 items it should add up to 268 but instead is totaled 270 once the order was edited. Not much difference but still an indication that something isn't working exactly correct.
-
Re: Edit Orders v4.0 Support Thread
Hi,
Does anyone know the reason for the 'Advanced Attributes Editor' being removed from Edit Orders 4.1.x ?
I've looked around and can't seem to find reference to it here in the Forum nor in Logs etc.
I just wondered if there was a specific reason I should know about before I go about butchering it back in place.
Many Thanks
-
Re: Edit Orders v4.0 Support Thread
Edit Orders 4.0 did all the math internally. Edit Orders 4.1 lets functions from the Zen Cart customer checkout and order total modules do most of the math.
Edit Orders 4.1.x currently allows changing attributes (as long as the attributes exist and are assigned to the product - so if the attribute shows on the customer side it shows on the admin side - if not on the customer side it is not an option on the admin side).
The "advanced" attribute editor allowed adding attributes which do not exist in the database to products. This led to an inconsistent customer experience. Also in some edge cases handling products or attributes not in the database can result in unintended side effects (and calculation errors).
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
May want to double check to ensure your change does not FORCE insurance on all orders when updated via edit orders (including when saving an order where the customer did not request insurance). The above runs a good likelyhood of also flipping insurance for any subsequent order as you are adding the change into the Store Admin's login session (persists beyond a single admin page / request).
May be better to update ot_insurance.php to check if the module was already part of the order and loaded via admin (and if both are true, flip the flag instead of adding to the session).
Hey Andy_M,
thanks for posting a solution to using the Optional Insurance module.
Just a question, have you picked up any issues up to now on your implementation?
Does it calculate correctly and avoid globalizing the insurance onto orders that were not originally selected for insurance?
-
Re: Edit Orders v4.0 Support Thread
Hello,
I successfully added Admin New Customer 3 this week to a functioning v1.5.3 ZC install.
Today I installed Edit Orders 4 and it appeared to go fine but when using the Update button to submit form on /edit_orders.php?page=1&oID=11435&action=update_order I get "WARNING: An Error occurred, please refresh the page and try again."
The error being logged by these is
PHP Fatal error: 1054:Unknown column 'p.products_quantity' in 'field list' ::
SELECT `p`.`products_quantity` FROM `products` WHERE `p`.`products_id` = '153' ==>
(as called by) /[snip]myadmin/includes/functions/extra_functions/edit_orders_functions.php on line 1028
<== in [snip]/includes/classes/db/mysql/query_factory.php on line 155
On checking the referenced line I found that the query did not supply the alias p for the table...
$check = $db->Execute(
'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` ' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
After changing the above code to TABLE_PRODUCTS . '` p ' . the error was resolved.
Since editing an order occurs post sale should I assume that order total and weights/shipping amounts will not be affected by edits?
Thanks!
David
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
jerrygarciuh
...
The error being logged by these is
PHP Fatal error: 1054:Unknown column 'p.products_quantity' in 'field list' ::
SELECT `p`.`products_quantity` FROM `products` WHERE `p`.`products_id` = '153' ==>
(as called by) /[snip]myadmin/includes/functions/extra_functions/edit_orders_functions.php on line 1028
<== in [snip]/includes/classes/db/mysql/query_factory.php on line 155
...
Glad you were able to solve the issue you were experiencing. The issue (and solution) previously posted is very similiar (just a bit more explicit).
If you are not already, I've found adding "site:zen-cart.com" to the end of search queries on Bing and Google to be very helpful when searching this site (forums, wiki, plugins, etc). I've found it especially helpful (and time saving) when searching for specific error messages or bugs / bugfixes.
Quote:
Originally Posted by
jerrygarciuh
...
Since editing an order occurs post sale should I assume that order total and weights/shipping amounts will not be affected by edits? ...
Yes and No.
Nope. When you add / remove / update items (or totals / addresses) in an order the Zen Cart code for processing order totals is run again, so order totals will be updated (unless the order total module is not compatibble with being loaded from the admin and interacting directly with $order).
Yes. The shipping module code to generate a shipping quote is not called, so shipping is not recalculated and will appear in the admin as the customer selected (as long as they are not changed - and the shipping module is enabled).
-
1 Attachment(s)
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Nope. When you add / remove / update items (or totals / addresses) in an order the Zen Cart code for processing order totals is run again, so order totals will be updated (unless the order total module is not compatible with being loaded from the admin and interacting directly with $order).
Thank you for the reply! I am using Local Sales Tax but otherwise I believe my Order Total process is default one for v1.5.3.
When I update order items I am seeing taxes calculated correctly for the new order total but the sub-total is coming up $0.00. The completed order total is being calculated a $0 for subtotal and then correctly adding current shipping amount and tax.
In this example I have deleted a hat which was only item in a real order after using Edit Orders to add two cases of hot sauce.
Attachment 15518
Do you have any advice on sub-total issue or should I dig into code and see what I can find?
Appreciate the help!
-
Re: Edit Orders v4.0 Support Thread
Usually means the subtotal stored in the database is no longer synced (it is not recalculated by Edit Orders). I've also seen this in the past when 'ot_subtotal' (Subtotal Order Total Module) is disabled (needs to be enabled for Edit Orders to work correctly). The most common cause is if there was an ERROR while updating an order (such as the `p` one you saw). Quickest fix is to just update the two related database tables by hand (if you really need to keep the order), or just delete and re-create the order.
For reference it will be the row in the table 'orders_total' corresponding to the row storing the value of 'ot_subtotal' for the order.
-
Re: Edit Orders v4.0 Support Thread
OK, thank lhungil! I appreciate your time and the mods! Order Sub-Total was enabled so I will dig in and see what I find. If anything useful comes up I will post here.
Peace,
David
-
Re: Edit Orders v4.0 Support Thread
I grepped files for EO_DEBUG_ACTION_LEVEL to see where it was being defined()ed but it looks like in my distro it is not defined. Since all references in codebase come from edit_orders.php I define()ed it at top of that file.
Debug output appears to show the new products being added and subsequently removed by the update routine...
I tried enabling SQL logging for whole store briefly but while edit_orders.php select statements appear to be logged, the update SQL was not.
Digging further now...
============================================================
Code:
= Edit Orders (4.1.4) Action Log
============================================================
Order ID: 11435
Action Requested: update_order
Enabled Order Totals: ot_subtotal;ot_shipping;ot_coupon;ot_group_pricing;ot_tax;ot_local_sales_taxes;ot_loworderfee;ot_gv;ot_total
Order Subtotal: 0.0000
Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$16.24',
'class' => 'ot_total',
),
)
Order Tax (total): 1.59
Order Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
)
Requested Products:
array (
17668 =>
array (
'qty' => '1',
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4',
'final_price' => '19.88',
),
17669 =>
array (
'qty' => '1',
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4',
'final_price' => '19.88',
),
)
============================================================
= Processing Requested Updates to Products
============================================================
Products in Original Order:
array (
0 =>
array (
'qty' => 1,
'id' => '29',
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4.0000',
'price' => '19.8800',
'final_price' => '19.8800',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
),
1 =>
array (
'qty' => 1,
'id' => '29',
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4.0000',
'price' => '19.8800',
'final_price' => '19.8800',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
),
)
Order Product ID: 17668 Row ID: 0
Product in Request:
array (
'qty' => 1,
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4',
'final_price' => '19.88',
)
Old Product:
array (
'qty' => 1,
'id' => '29',
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4.0000',
'price' => '19.8800',
'final_price' => '19.8800',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
)
Old Order Subtotal: 0.0000
Old Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$16.24',
'class' => 'ot_total',
),
)
Old Tax (total): 1.59
Old Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
)
Removed Product Order Subtotal: -19.88
Removed Product Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$-19.88',
'class' => 'ot_subtotal',
'value' => -19.88,
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$0.79',
'class' => 'ot_tax',
'value' => 0.7948,
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$-7.94',
'class' => 'ot_total',
'value' => -7.9352,
),
)
Removed Product Tax (total): 0.7948
Removed Product Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 0.7952,
)
Added Product:
array (
'id' => 29,
'qty' => 1,
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'price' => '19.8800',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_virtual' => '0',
'product_is_always_free_shipping' => '0',
'tax' => '4',
'tax_description' => '4.0% Louisiana Sales Tax',
'onetime_charges' => 0,
'final_price' => '19.88',
)
Added Product Order Subtotal: 0
Added Product Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
'value' => 0,
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
'value' => 1.59,
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$12.74',
'class' => 'ot_total',
'value' => 12.74,
),
)
Added Product Tax (total): 1.59
Added Product Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
)
Order Product ID: 17669 Row ID: 0
Product in Request:
array (
'qty' => 1,
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4',
'final_price' => '19.88',
)
Old Product:
array (
'qty' => 1,
'id' => '29',
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4.0000',
'price' => '19.8800',
'final_price' => '19.8800',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
)
Old Order Subtotal: 0
Old Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
'value' => 0,
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
'value' => 1.59,
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$12.74',
'class' => 'ot_total',
'value' => 12.74,
),
)
Old Tax (total): 1.59
Old Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
)
Removed Product Order Subtotal: -19.88
Removed Product Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$-19.88',
'class' => 'ot_subtotal',
'value' => -19.88,
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$0.79',
'class' => 'ot_tax',
'value' => 0.7948,
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$-7.94',
'class' => 'ot_total',
'value' => -7.9352,
),
)
Removed Product Tax (total): 0.7948
Removed Product Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 0.7952,
)
Added Product:
array (
'id' => 29,
'qty' => 1,
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'price' => '19.8800',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_virtual' => '0',
'product_is_always_free_shipping' => '0',
'tax' => '4',
'tax_description' => '4.0% Louisiana Sales Tax',
'onetime_charges' => 0,
'final_price' => '19.88',
)
Added Product Order Subtotal: 0
Added Product Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
'value' => 0,
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
'value' => 1.59,
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$12.74',
'class' => 'ot_total',
'value' => 12.74,
),
)
Added Product Tax (total): 1.59
Added Product Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
)
Updated Products in Order:
array (
0 =>
array (
'qty' => 1,
'id' => '29',
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4.0000',
'price' => '19.8800',
'final_price' => '19.8800',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
),
1 =>
array (
'qty' => 1,
'id' => '29',
'name' => '6oz. [snipped] (Case of 24)',
'model' => '',
'tax' => '4.0000',
'price' => '19.8800',
'final_price' => '19.8800',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
),
)
Updated Products Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$16.24',
'class' => 'ot_total',
),
)
Updated Products Tax (total): 1.59
Updated Products Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
)
Requested Order Totals:
array (
0 =>
array (
'code' => 'ot_shipping',
'shipping_module' => 'fedexwebservices',
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'value' => '11.1500',
),
1 =>
array (
'code' => 'ot_loworderfee',
'title' => 'Handling Fee:',
'value' => '3.5000',
),
2 =>
array (
'code' => 'ot_coupon',
'title' => '',
'value' => '',
'shipping_module' => '',
),
)
============================================================
= Processing Requested Updates to Order Totals
============================================================
Starting Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
),
3 =>
array (
'title' => 'Handling Fee:',
'text' => '$3.50',
'class' => 'ot_loworderfee',
),
4 =>
array (
'title' => 'Total:',
'text' => '$16.24',
'class' => 'ot_total',
),
)
Starting Tax (total): 1.59
Starting Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
)
Updated Order Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
),
3 =>
array (
'title' => 'Total:',
'text' => '$16.24',
'class' => 'ot_total',
),
)
Updated Tax (total): 1.59
Updated Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
'' => 0,
)
============================================================
= Done Processing Requested Updates to the Order
============================================================
Final Subtotal: 0.0000
Final Totals:
array (
0 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
),
1 =>
array (
'title' => 'FedEx (1 x 2.00lbs) (Ground Home Delivery):',
'text' => '$11.15',
'class' => 'ot_shipping',
),
2 =>
array (
'title' => '4.0% Louisiana Sales Tax:',
'text' => '$1.59',
'class' => 'ot_tax',
),
3 =>
array (
'title' => 'Total:',
'text' => '$16.24',
'class' => 'ot_total',
),
)
Final Tax (total): 1.59
Final Tax Groups:
array (
'4.0% Louisiana Sales Tax' => 1.5904,
'' => 0,
)
-
Re: Edit Orders v4.0 Support Thread
New clue- the original order had a cap which I removed when adding the new products. When I add cap back to order the subtotal correctly reflects the cap but not the added products. Remove cap and subtotal goes back to zero.
-
Re: Edit Orders v4.0 Support Thread
Once the subtotal is out of sync it will remain out of sync unless you either manually update the database table mentioned previously or the order is deleted and recreated. Continuing to play with the order via Edit Orders will not help until one of those two items is done.
Is this the same order as the one you were trying to edit when you received the "WARNING -" and the associated Zen Cart DEBUG log? If it is, this was probably the cause for the subtotal going out of sync on the order (as the process crashed while modifying the order).
-
Re: Edit Orders v4.0 Support Thread
OK, thank you!
Quote:
Originally Posted by
lhungil
Once the subtotal is out of sync it will remain out of sync unless you either manually update the database table mentioned previously or the order is deleted and recreated. Continuing to play with the order via Edit Orders will not help until one of those two items is done.
Is this the same order as the one you were trying to edit when you received the "WARNING -" and the associated Zen Cart DEBUG log? If it is, this was probably the cause for the subtotal going out of sync on the order (as the process crashed while modifying the order).
-
Re: Edit Orders v4.0 Support Thread
Using zen cart 1.5.4 , edit orders 4 ,stock by attribute 1.5.4.
In step 1 of adding a product to order , a search box appears. Could someone tell me if there is a way for that function to be told to include the customid column of the products with attributes stock database table and output the item that goes with the customid ?
-
Re: Edit Orders v4.0 Support Thread
Hello everyone!
I've been poking around this thread for about a week now and i can't seem to find why my sub total and total doesn't update.
I reinstalled twice and it still doesn't work.
I use ZC 1.5.4 and as lhungil said, i tried with new order to rule out the out of sync problem with the DB.
If someone can give me a hint on where to look, that would be awesome.
Thanks in advance
Here is the log file :
Code:
============================================================
= Edit Orders (4.1.4) Action Log
============================================================
Order ID: 4
Action Requested: update_order
Enabled Order Totals: ot_subtotal;ot_shipping;ot_coupon;ot_group_pricing;ot_tax;ot_gv;ot_total
Order Subtotal: 129.9500
Order Totals:
array (
0 =>
array (
'title' => 'Store Pickup (Walk In):',
'text' => '$0.00',
'class' => 'ot_shipping',
),
1 =>
array (
'title' => 'Sub-Total:',
'text' => '$129.95',
'class' => 'ot_subtotal',
),
2 =>
array (
'title' => 'Total:',
'text' => '$149.41',
'class' => 'ot_total',
),
)
Order Tax (total): 0.00
Order Tax Groups:
array (
'TPS/TVQ (14.975%)' => 19.460012499999998,
)
Requested Products:
array (
51 =>
array (
'qty' => '2',
'name' => '30" Lifegard Aquatics Ultra-Slim Blue/White LED Light',
'model' => '',
'tax' => '14.975',
'final_price' => '129.95',
),
)
============================================================
= Processing Requested Updates to Products
============================================================
Products in Original Order:
array (
0 =>
array (
'qty' => 1,
'id' => '477',
'name' => '30" Lifegard Aquatics Ultra-Slim Blue/White LED Light',
'model' => '',
'tax' => '14.9750',
'price' => '129.9500',
'final_price' => '129.9500',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
),
)
Order Product ID: 51 Row ID: 0
Product in Request:
array (
'qty' => 2,
'name' => '30" Lifegard Aquatics Ultra-Slim Blue/White LED Light',
'model' => '',
'tax' => '14.975',
'final_price' => '129.95',
)
Old Product:
array (
'qty' => 1,
'id' => '477',
'name' => '30" Lifegard Aquatics Ultra-Slim Blue/White LED Light',
'model' => '',
'tax' => '14.9750',
'price' => '129.9500',
'final_price' => '129.9500',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
)
Old Order Subtotal: 129.9500
Old Order Totals:
array (
0 =>
array (
'title' => 'Store Pickup (Walk In):',
'text' => '$0.00',
'class' => 'ot_shipping',
),
1 =>
array (
'title' => 'Sub-Total:',
'text' => '$129.95',
'class' => 'ot_subtotal',
),
2 =>
array (
'title' => 'Total:',
'text' => '$149.41',
'class' => 'ot_total',
),
)
Old Tax (total): 0.00
Old Tax Groups:
array (
'TPS/TVQ (14.975%)' => 19.460012499999998,
)
Removed Product Order Subtotal: 0
Removed Product Order Totals:
array (
0 =>
array (
'title' => 'Store Pickup (Walk In):',
'text' => '$0.00',
'class' => 'ot_shipping',
),
1 =>
array (
'title' => 'Sub-Total:',
'text' => '$0.00',
'class' => 'ot_subtotal',
'value' => 0,
),
2 =>
array (
'title' => 'Total:',
'text' => '$-19.46',
'class' => 'ot_total',
'value' => -19.460012499999998,
),
)
Removed Product Tax (total): -19.4600125
Removed Product Tax Groups:
array (
'TPS/TVQ (14.975%)' => 0,
)
Added Product:
array (
'id' => 477,
'qty' => 2,
'name' => '30" Lifegard Aquatics Ultra-Slim Blue/White LED Light',
'model' => '',
'price' => '129.9500',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_virtual' => '0',
'product_is_always_free_shipping' => '0',
'tax' => '14.975',
'tax_description' => 'TPS/TVQ (14.975%)',
'onetime_charges' => 0,
'final_price' => '129.95',
)
Added Product Order Subtotal: 259.9
Added Product Order Totals:
array (
0 =>
array (
'title' => 'Store Pickup (Walk In):',
'text' => '$0.00',
'class' => 'ot_shipping',
),
1 =>
array (
'title' => 'Sub-Total:',
'text' => '$259.90',
'class' => 'ot_subtotal',
'value' => 259.89999999999998,
),
2 =>
array (
'title' => 'Total:',
'text' => '$279.36',
'class' => 'ot_total',
'value' => 279.36001249999998,
),
)
Added Product Tax (total): 19.4600125
Added Product Tax Groups:
array (
'TPS/TVQ (14.975%)' => 38.920024999999995,
)
Updated Products in Order:
array (
0 =>
array (
'qty' => 2,
'id' => '477',
'name' => '30" Lifegard Aquatics Ultra-Slim Blue/White LED Light',
'model' => '',
'tax' => '14.9750',
'price' => '129.9500',
'final_price' => '129.9500',
'onetime_charges' => '0.0000',
'products_priced_by_attribute' => '0',
'product_is_free' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
),
)
Updated Products Order Totals:
array (
0 =>
array (
'title' => 'Store Pickup (Walk In):',
'text' => '$0.00',
'class' => 'ot_shipping',
),
1 =>
array (
'title' => 'Sub-Total:',
'text' => '$129.95',
'class' => 'ot_subtotal',
),
2 =>
array (
'title' => 'Total:',
'text' => '$149.41',
'class' => 'ot_total',
),
)
Updated Products Tax (total): 0.00
Updated Products Tax Groups:
array (
'TPS/TVQ (14.975%)' => 38.920024999999995,
)
Requested Order Totals:
array (
0 =>
array (
'code' => 'ot_shipping',
'shipping_module' => 'storepickup',
'title' => 'Store Pickup (Walk In):',
'value' => '0.0000',
),
1 =>
array (
'code' => 'ot_coupon',
'title' => '',
'value' => '',
'shipping_module' => '',
),
)
============================================================
= Processing Requested Updates to Order Totals
============================================================
Starting Order Totals:
array (
0 =>
array (
'title' => 'Store Pickup (Walk In):',
'text' => '$0.00',
'class' => 'ot_shipping',
),
1 =>
array (
'title' => 'Sub-Total:',
'text' => '$129.95',
'class' => 'ot_subtotal',
),
2 =>
array (
'title' => 'Total:',
'text' => '$149.41',
'class' => 'ot_total',
),
)
Starting Tax (total): 0.00
Starting Tax Groups:
array (
'TPS/TVQ (14.975%)' => 38.920024999999995,
)
Updated Order Totals:
array (
0 =>
array (
'title' => 'Store Pickup (Walk In):',
'text' => '$0.00',
'class' => 'ot_shipping',
),
1 =>
array (
'title' => 'Sub-Total:',
'text' => '$129.95',
'class' => 'ot_subtotal',
),
2 =>
array (
'title' => 'Total:',
'text' => '$149.41',
'class' => 'ot_total',
),
)
Updated Tax (total): 0.00
Updated Tax Groups:
array (
'TPS/TVQ (14.975%)' => 38.920024999999995,
)
============================================================
= Done Processing Requested Updates to the Order
============================================================
Final Subtotal: 129.9500
Final Totals:
array (
0 =>
array (
'title' => 'Store Pickup (Walk In):',
'text' => '$0.00',
'class' => 'ot_shipping',
),
1 =>
array (
'title' => 'Sub-Total:',
'text' => '$129.95',
'class' => 'ot_subtotal',
),
2 =>
array (
'title' => 'Total:',
'text' => '$149.41',
'class' => 'ot_total',
),
)
Final Tax (total): 0.00
Final Tax Groups:
array (
'TPS/TVQ (14.975%)' => 38.920024999999995,
)
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
B-Noid
I've been poking around this thread for about a week now and i can't seem to find why my sub total and total doesn't update.
Nevermind my last post... I finally found my problem! :D
Turns out i didn't delete line 44 of /includes/classes/order_total.php like i was suppose to... :lamo:
PHP Code:
$module_file = DIR_WS_MODULES . 'order_total/' . $value;
Thank you for your time and this is a great plugin BTW
Have a good one!
-
Re: Edit Orders v4.0 Support Thread
I've been using ZC for quite a while, and have been using Edit Orders as a staple add-on.
At first I thought this might be related to rewards points, but after installing both the latest version of Rewards Points 2.5e and Edit order 4.1.4. Im beginning to think it's something else.
While editing an order, changing, updating any user information, adding products, or no change made at all, edit order will throw an error of the following after pressing the "update" button:
WARNING: An Error occurred, please refresh the page and try again.
If it's editing user information or adding a product, refreshing the order page will show the changes even after the error will show the changes.
However, trying to delete a product from an order, will throw the same error, but does not actually remove the product from the order.
Debug file shows this:
[01-Oct-2015 23:31:19 America/Los_Angeles] PHP Fatal error: 1054:Unknown column 'p.products_quantity' in 'field list' :: SELECT `p`.`products_quantity` FROM `products` WHERE `p`.`products_id` = '5646' ==> (as called by) /home/webuser/shopping/someadmin/includes/functions/extra_functions/edit_orders_functions.php on line 1028 <== in /home/webuser/shopping/includes/classes/db/mysql/query_factory.php on line 155
My configuration is the following:
Zen-Cart v1.5.4 Database Patch Level: 1.5.4 (From Server_info.php)
Edit Order 4.1.4
Reward Points 2.5e
Centos 6 Linux 2.6.32-504.23.4.el6.x86_64
MySQL 5.6.23-log (AWS RDS)
Apache/2.2.15
PHP 5.6.10
I can't seem to figure what's causing this, and kinda stumped on how to go about fixing it. Any insight would be most appreciated!
-
Re: Edit Orders v4.0 Support Thread
That particular error pops up here and there every once in a while and in fact saw that someone else had it recently. Darned if I could remember the specific program/area to address, but if you install lat9's mydebug backtrace available in the plugins of this site, it should provide more detailed information about where the particular sql statement is that is causing that error.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
mc12345678
That particular error pops up here and there every once in a while and in fact saw that someone else had it recently. Darned if I could remember the specific program/area to address, but if you install lat9's mydebug backtrace available in the plugins of this site, it should provide more detailed information about where the particular sql statement is that is causing that error.
See this (https://www.zen-cart.com/showthread....66#post1235066) Edit Orders post for the solution.
-
Re: Edit Orders v4.0 Support Thread
Apparently that was the issue! Applied the changes and it works!
Thanks!
Quote:
Originally Posted by
lat9
-
Re: Edit Orders v4.0 Support Thread
Hi All. I have searched the forum and this EO thread to no avail. I'm hoping someone can help.
Installed:
ZC 1.5.1
EO 4.1.4
Admin New Order 1.5
2 issues:
1. When creating a new order from the admin section, once a product is added, the tax field shows a 0 (product is set as a taxable item and zones are set properly). If I try to update, the updated tax% shows (as 5%), but is not calculated in the total.
2. The coupon field also does not update when added.
Any help with this would be greatly appreciated!
If you need any further information, please let me know.
-
Re: Edit Orders v4.0 Support Thread
Update:
1. I now have the tax rate being calculated in the total once the 0% is updated to 5%. (configuration settings)
**However, all products show a 0% tax on being added in Edit Orders before manually updating tax %.
**NOTE: when order is created via the online shop, tax is correctly added. This issue happens ONLY when adding a new order (Admin New Order) from the admin area.
2. Coupon codes being added is fixed. Issue was in the coupon admin settings.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
gigi3
... 1. I now have the tax rate being calculated in the total once the 0% is updated to 5%. (configuration settings)
**However, all products show a 0% tax on being added in Edit Orders before manually updating tax %.
**NOTE: when order is created via the online shop, tax is correctly added. This issue happens ONLY when adding a new order (Admin New Order) from the admin area. ...
What are your settings in "admin" -> "Configuration" -> "Customer Details"? In particular the settings for "State" and "State - Always display as pulldown?"?
What are your settings in "admin" -> "Configuration" -> "My Store"? In particular the settings for "Country", "Zone" (state), "Basis of Product Tax", and "Basis of Shipping Tax"?
Are there any other 3rd party tax plugins installed (such as those for VAT or Local Sales Taxes)?
Any Zen Cart debug logs (not asking for Edit Orders debug logs, just any Zen Cart debug logs)?
Have you verified the order contains the correct address to trigger Zen Cart tax rules (and the Zone / State exists in the database)? Please note if you change the address, you will need to save the new address information by clicking "update" before adding products (otherwise the address changes will not be saved).
Also note with the current version of Edit Orders (at the time of writing 4.1.4) once an editable field contains data (such as the tax rate containing a 0), this value will always be used (instead of the value automatically generated by Zen Cart for the field). This is necessary to allow people to override the default values.
When using "Admin New Order" to create a new "blank" order for a customer... "Edit Orders" appears to work as expected in my Zen Cart 1.5.1 and 1.5.4 test stores (clean install w/ demo data + "Admin New Customer", "Admin New Order", and "Edit Orders".)... When a product is added to a "blank" order, when adding a new product the correct tax rate is used for the product based upon the tax status of the product, the store settings, and the address.
To test I first added a product to an order with a state configured for no tax (this is all states except Florida in the demo data); resulting in a 0% tax rate on the added product. Next I changed the address to a state configured for tax (Florida is a 7% tax rate in the demo data); resulting in a 7% tax rate on the added product.
Quote:
Originally Posted by
gigi3
... 2. Coupon codes being added is fixed. Issue was in the coupon admin settings.
Can you elaborate (for all of the viewers at home)?
-
Re: Edit Orders v4.0 Support Thread
Thank you so much for your response, lhungil!
I think you've hit on my issue. These orders are created in the admin using the Admin New Order plugin because these orders are 'in store' and no address is needed. The products all have a 5% tax rate for in store sales. Is there a way to set the tax rate so there is no need to depend on the address of the client for calculation?
The online orders work proprerly, of course, because our online clients include an address for shipping in their order.
As for #2. The coupon was set to a minimum order of $100. *blush* Easy fix. ;)
-
Re: Edit Orders v4.0 Support Thread
Just an afterthought, the entire customer base, including both our online customers and our in store customers are in Canada. We have, and will have, no customers outside of Canada.
-
Re: Edit Orders v4.0 Support Thread
Fixed it.
Created a new Zone for all of Canada with a set tax rate. I had it set for 2 separate zones to accommodate shipping rates.
Seems to work. Thank you for taking the time!
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
gigi3
... I think you've hit on my issue. These orders are created in the admin using the Admin New Order plugin because these orders are 'in store' and no address is needed. The products all have a 5% tax rate for in store sales. Is there a way to set the tax rate so there is no need to depend on the address of the client for calculation? ...
You could just enter the store's address for the order. This way the tax rate for the store location would be used (and recorded as the location for reports and potential tax audits). And don't forget the store location must have a configured tax rate.
If you have time, you could modify "Admin New Order" to add an "In Store Purchase" button. When pressed, the code could be altered to automatically add the store's address to the order as the shipping address (and continue to pull the customer / billing from the database if present).
Quote:
Originally Posted by
gigi3
... Created a new Zone for all of Canada with a set tax rate. ...
Thank you for reporting more details about how you are using "Admin New Order" and "Edit Orders" and your solution!
I am not conversant with CAN tax rules (so ignore the next sentence if it does not apply)... My only concern would be this change may impact customers shopping online from other locations in CAN where you (the seller) may not be required to collect and remit tax (or need to do so at a different rate).
If you want better reporting (and order records), you may want to think about also adding the modifications I mentioned above to "Admin New Order" in the future (and add the tax rate for the physical store location).
-
Re: Edit Orders v4.0 Support Thread
Great info, lhungil. I will look into the "In Store Purchase" button!
As you say, the different areas of Canada do, indeed, have different tax rates, based on province. Luckily for us, we only charge GST (Country wide) and not PST (Provincial) so the set up we have will work, though, it may be smart to be prepared for possible changes. You never know!
-
Re: Edit Orders v4.0 Support Thread
Hi All,
Sorry to bug, yet again, but I am now getting the dreaded 'white screen' when attempting to update an order via edit_orders.php
log message: PHP Fatal error: Call to undefined function validate_for_category() in /home/content/11/6854611/html/shop/admin/includes/functions/extra_functions/edit_orders_functions.php on line 331
line 331
Quote:
$allow_for_category = validate_for_category($product_id, $coupon_id);
Any help would be greatly appreciated!
-
Re: Edit Orders v4.0 Support Thread
Update:
I believe it was an edit I made to the edit_orders.php file (Cosmetic). I uploaded a fresh copy and it is working. Thx.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
gigi3
Update:
I believe it was an edit I made to the edit_orders.php file (Cosmetic). I uploaded a fresh copy and it is working. Thx.
Thank You for letting us know. out of curiosity, what is the cosmetic change you desired?
-
Re: Edit Orders v4.0 Support Thread
I added another 'edit' button directly to the left of the 'add product' button, and added another 'details' button directly below the order total, renaming the .gif 'submit'. The idea is to simplify the screen for cashiers. Edit Orders automatically stores the order which we felt may be confusing for the cashiers with nothing to click to 'complete' the order....
I also commented out the payment method section, as we use only one payment method and currently don't use that portion, again, the goal being to simplify the page for the cashiers.
A fresh edit_orders.php version seems to work, and, after adding the 'edit' and the renamed 'details' button without commenting out the payment method WAS working for a while...then, all of a sudden, after attempting to add a coupon, I get the white screen again.
It seems to happen when a coupon is added. I have recently set up coupons with restricted categories. I'm wondering if that is part of the problem as the error message references categories?
Any thoughts?
-
Re: Edit Orders v4.0 Support Thread
So, I just uploaded another fresh copy of edit_orders.php and it is giving me the 'white screen' when I attempt to add a coupon. It seems it is not the changes I have made.
I am receiving the same error message in the logs:
Quote:
[14-Oct-2015 08:45:50] PHP Fatal error: Call to undefined function validate_for_category() in /html/shop/admin/includes/functions/extra_functions/edit_orders_functions.php on line 331
Any help would be greatly appreciated!
-
Re: Edit Orders v4.0 Support Thread
Added:
I am also noticing that after I get the initial white screen from adding a coupon, I get the white screen for ANY 'edit' I make on the page, save for adding a new product....
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
gigi3
So, I just uploaded another fresh copy of edit_orders.php and it is giving me the 'white screen' when I attempt to add a coupon. It seems it is not the changes I have made.
I am receiving the same error message in the logs:
Any help would be greatly appreciated!
My copy of /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php has the following code block added, just above the function declaration for eo_debug_action_level_list:
Code:
//-bof-20140423-lat9-forum bugfix
if(!function_exists('validate_for_category')) {
function validate_for_category($product_id, $coupon_id) {
global $db;
$retVal = 'none';
$productCatPath = zen_get_product_path($product_id);
$catPathArray = array_reverse(explode('_', $productCatPath));
$sql = "SELECT count(*) AS total
FROM " . TABLE_COUPON_RESTRICT . "
WHERE category_id = -1
AND coupon_restrict = 'Y'
AND coupon_id = " . (int)$coupon_id . " LIMIT 1";
$checkQuery = $db->execute($sql);
foreach ($catPathArray as $catPath) {
$sql = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "
WHERE category_id = " . (int)$catPath . "
AND coupon_id = " . (int)$coupon_id;
$result = $db->execute($sql);
if ($result->recordCount() > 0 && $result->fields['coupon_restrict'] == 'N') return true;
if ($result->recordCount() > 0 && $result->fields['coupon_restrict'] == 'Y') return false;
}
if ($checkQuery->fields['total'] > 0) {
return false;
} else {
return 'none';
}
}
}
if(!function_exists('validate_for_product')) {
function validate_for_product($product_id, $coupon_id) {
global $db;
$sql = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "
WHERE product_id = " . (int)$product_id . "
AND coupon_id = " . (int)$coupon_id . " LIMIT 1";
$result = $db->execute($sql);
if ($result->recordCount() > 0) {
if ($result->fields['coupon_restrict'] == 'N') return true;
if ($result->fields['coupon_restrict'] == 'Y') return false;
} else {
return 'none';
}
}
}
//-eof-20140423-lat9
-
Re: Edit Orders v4.0 Support Thread
I apologize for my late response...I caught a nasty bug and was in bed for the last few days...ugh.
That update seems to work like a charm. Thank you, so much!
-
Re: Edit Orders v4.0 Support Thread
Hi All,
I have been searching the forum for info, but haven't come across it yet and thought I'd ask here.
As we are using Zen Cart for In Store orders, I am wondering if there is any addon for when a client pays by cash where you can input the cash amount and it will calculate change?
I am posting this here in the Edit Order thread as it seems logical that most people using Zen Cart for In Store purchases will be using Edit Orders + New Order.
If anyone has any thoughts I'd love to hear them. Thanks!
Thanks.