Administrator
- Join Date:
- Sep 2009
- Location:
- Stuart, FL
- Posts:
- 14,067
- Plugin Contributions:
- 56
Edit Orders v4.0 Support Thread
@webchills, did you also try ticking the "Reset totals prior to update" box?
Views: 346,060
Administrator
@webchills, did you also try ticking the "Reset totals prior to update" box?
Zen Follower
lat9:
@webchills, did you also try ticking the "Reset totals prior to update" box?
Yes, same wrong result
Administrator
Hmm, when I use your setup instructions and place an order containing that product, instead of
Sub-Total: €29.90
Flat Rate (Best Way): €5.89
19%: €5.57
Total: €35.79
... I get
Sub-Total: €29.90
Flat Rate (Best Way): €4.95
19%: €5.57
Total: €34.86
Any idea what's different (other than the result)?
Administrator
Note that regardless the storefront calculations, EO doesn't recalculate correctly as @webchills described. At this point, I've got the issue modeled and will continue investigations.
Zen Follower
Sorry was a typo, the shipping fee is of course 4.95 gross in frontend.
I guess, things would be much easier to handle if Zen Cart would store the tax rate of the shipping fee and the tax amount of the shipping fee in separate fields in the orders_total table which is not the case right now.
For Edit Orders I would suggest that the tax amount should be editable as well to be able to correct such miscalculations. Should be calculated correctly though.
Administrator
@webchills, I agree on both counts. I've created a GitHub issue to change EO (for the next, major, release) to enable the editing of the "ot_tax" value.
New Zenner
Am a linux novice. Have v1.5.5f on a test setup and trying to install Edit Orders v4.3.4. Used KDiff3 to merge files per instructions.
The install seems to go fine but when I go to an order and click on Update it gives me page with only "Warning: An Error occurred, please refresh the page and try again." This happens whether or not I make any changes to order.
Any suggestions very much appreciated.
Operating system Ubuntu Linux 16.04.3
Perl version 5.022001
Apache version 2.4.18
PHP versions 7.0.30
MySQL version 5.7.23-0ubuntu0.16.04.1
Here is error log file:
[13-Aug-2018 09:58:58 America/New_York] Request URI: /ADMIN/edit_orders.php?selected_box=customers&status=2&page=1&oID=3&action=update_order, IP address: 1xx.xxx.xxx.xxx
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at /ADMIN/includes/functions/database.php:53]
#5 zen_db_perform() called at /ADMIN/includes/functions/extra_functions/edit_orders_functions.php:1394]
#6 eo_update_database_order_total() called at [/ADMIN/edit_orders.php:581]
[13-Aug-2018 09:58:58 America/New_York] PHP Fatal error: 1366:Incorrect integer value: '' for column 'sort_order' at row 2 :: update orders_total set title = 'Flat Rate (Best Way):', text = '$5.00', value = '5', sort_order = '' where class='ot_shipping' AND orders_id=3 ==> (as called by) /ADMIN/includes/functions/database.php on line 53 <== in /includes/classes/db/mysql/query_factory.php on line 171
Administrator
@Ted Grapler, edit the file /admin/includes/functions/extra_functions/edit_orders_functions.php. On/about line 1371, find the following code fragment
function eo_update_database_order_total($oID, $order_total) {
global $db, $eo;
$updated = false;
$sql_data_array = array(
'title' => $order_total['title'],
'text' => $order_total['text'],
'value' => (is_numeric($order_total['value'])) ? $order_total['value'] : 0,
'sort_order' => $order_total['sort_order']
);
and make the highlighted change
function eo_update_database_order_total($oID, $order_total) {
global $db, $eo;
$updated = false;
$sql_data_array = array(
'title' => $order_total['title'],
'text' => $order_total['text'],
'value' => (is_numeric($order_total['value'])) ? $order_total['value'] : 0,
'sort_order' => [B](int)[/B]$order_total['sort_order']
);
Note also that you should also check your Modules->Order Totals to ensure that the "Sort Order" for the ot_shipping total is a valid numeric value.
New Zenner
Thank you lat9. That fixed the issue.
Zen Follower
version 1.3.9 whenver i try to edit an order by chaning say table rate , in orders page the price inclusive and eclusive gets same and all price get changed. Any help!
Administrator
Version 1.3.9 of what? If you're running Zen Cart v1.3.9{something}, this version of edit orders is not supported.
Administrator
I've just submitted v4.3.5 of EO to the Zen Cart plugins for review and will post back here once it's approved.
This release contains changes associated with the following GitHub issues:
#87: New settings not added on initial installation.
#86: Sanitize order totals' sort-orders to ensure numeric values.
Administrator
lat9:
I've just submitted v4.3.5 of EO to the Zen Cart plugins for review and will post back here once it's approved.
This release contains changes associated with the following GitHub issues:#87: New settings not added on initial installation.
#86: Sanitize order totals' sort-orders to ensure numeric values.
Now available for download from the Zen Cart plugins: https://www.zen-cart.com/downloads.php?do=file&id=1513
New Zenner
Log in to your Admin
Go to configuration and then down to Edit Orders
This is where you would go to look to see what version you currently have installed in the Zen Cart?
Administrator
drm1963:
Log in to your Admin
Go to configuration and then down to Edit OrdersThis is where you would go to look to see what version you currently have installed in the Zen Cart?
Yes, that is where the current version for Edit Orders is displayed.
Zen Follower
Was told to post this error from my logs file here - any idea what is causing this:
zen 1.5.5f - php 7.1 - version 4.3.3 of 'edit-orders'
[02-Dec-2018 00:34:13 UTC] Request URI: /adminxxxxxx/edit_orders.php?page=1&oID=243424&action=update_order, IP address: 160.3.207.42
#1 zen_round() called at [/home/honor/public_html/includes/classes/currencies.php:94]
#2 currencies->value() called at [/home/honor/public_html/adminxxxxxx/includes/classes/editOrders.php:436]
#3 editOrders->eoRoundCurrencyValue() called at [/home/honor/public_html/adminxxxxxx/includes/classes/editOrders.php:441]
#4 editOrders->eoFormatCurrencyValue() called at [/home/honor/public_html/adminxxxxxx/edit_orders.php:475]
[02-Dec-2018 00:34:13 UTC] PHP Warning: A non-numeric value encountered in /home/honor/public_html/adminxxxxxx/includes/functions/general.php on line 1783
Administrator
Did you apply the modifications required by EO to your store's /includes/classes/order.php and /YOUR_ADMIN/includes/classes/order.php?
The EO call that the debug-log is complaining about occurs during EO's update processing when it's recreating the order's totals, converting their (presumed) numeric value to a currency-based string display.
The as-shipped storefront order-class doesn't include the numeric portion of an order-total's value when it recreates an order; that's what the storefront changes required by EO do.
Turn on the Edit Orders debug via its configuration setting, update that order again and send me a copy of the log (it'll be big) to my direct email address, which I'll PM to you.
Zen Follower
lat9:
Did you apply the modifications required by EO to your store's /includes/classes/order.php and /YOUR_ADMIN/includes/classes/order.php?
The EO call that the debug-log is complaining about occurs during EO's update processing when it's recreating the order's totals, converting their (presumed) numeric value to a currency-based string display.
The as-shipped storefront order-class doesn't include the numeric portion of an order-total's value when it recreates an order; that's what the storefront changes required by EO do.
Turn on the Edit Orders debug via its configuration setting, update that order again and send me a copy of the log (it'll be big) to my direct email address, which I'll PM to you.
I couldn't find where to turn on the Edit Orders debug. The only settings i have under configuration/edit orders are these:
Administrator
lidlchris:
I couldn't find where to turn on the Edit Orders debug. The only settings i have under configuration/edit orders are these:
Hmm, somehow the 'base' Edit Orders' configuration settings got "lost". Copy the following (EO's uninstall SQL script) into your admin's Tools->Install SQL Patches and run it.
DELETE FROM configuration WHERE configuration_key LIKE 'EO_%';
DELETE FROM configuration_group WHERE configuration_group_title = 'Edit Orders' LIMIT 1;
DELETE FROM admin_pages WHERE page_key IN ('editOrders', 'configEditOrders');
That will remove EO's configuration values and, since you're not removing any of the EO initialization files, the full default EO configuration will be created.
Zen Follower
lat9:
Hmm, somehow the 'base' Edit Orders' configuration settings got "lost". Copy the following (EO's uninstall SQL script) into your admin's Tools->Install SQL Patches and run it.
DELETE FROM configuration WHERE configuration_key LIKE 'EO_%';
DELETE FROM configuration_group WHERE configuration_group_title = 'Edit Orders' LIMIT 1;
DELETE FROM admin_pages WHERE page_key IN ('editOrders', 'configEditOrders');
> That will remove EO's configuration values and, since you're not removing any of the EO initialization files, the full default EO configuration will be created.
ok, i did this and when i went into my admin section it showed 'edit orders installed' message. So then i went to edit an order and this is what i got (fake admin address):
[14-Dec-2018 01:34:50 UTC] Request URI: /fakeadmin/edit_orders.php?page=1&oID=243424&action=update_order, IP address: 160.3.207.42
#1 zen_round() called at [/home/honor/public_html/includes/classes/currencies.php:94]
#2 currencies->value() called at [/home/honor/public_html/fakeadmin/includes/classes/editOrders.php:436]
#3 editOrders->eoRoundCurrencyValue() called at [/home/honor/public_html/fakeadmin/includes/classes/editOrders.php:441]
#4 editOrders->eoFormatCurrencyValue() called at [/home/honor/public_html/fakeadmin/edit_orders.php:475]
[14-Dec-2018 01:34:50 UTC] PHP Warning: A non-numeric value encountered in /home/honor/public_html/fakeadmin/includes/functions/general.php on line 1783
Here is the coding at that line:
```html
function zen_round($value, $precision) {
$value = round($value *pow(10,$precision),0);
$value = $value/pow(10,$precision);
return $value;
}
Fields marked required must be completed.
Tell staff why this post should be reviewed.