Zen Cart Logo
Forums / Addon Admin Tools / Edit Orders v4.0 Support Thread

Edit Orders v4.0 Support Thread

Views: 346,059

Results 1,281 to 1,300 of 1,927
20 Mar 2018, 11:22 PM
#1281
s_thomas avatar

s_thomas

New Zenner

Join Date:
Oct 2015
Posts:
5
Plugin Contributions:
0

Edit Orders v4.0 Support Thread

Hi there

I just installed the module and am running into an issue that I have tracked down to the (IS_ADMIN_FLAG === true) in the /includes/classes/shipping file.
I am using Edit orders 4.1.7 and running Zen Cart 1.5.4

In the admin section the pages are not loading because of an file load error. If I hack the IS_ADMIN_FLAG then the pages loads with out errors. I am going with the assumption that there is an issue with the admin files calling the catalog files or that there is an issue with using a shipping file that is a core 1.5.5a when I am running 1.5.4. Any help would be appreciated.
Thanks

if (IS_ADMIN_FLAG === true) {
          $lang_file = zen_get_file_directory(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/shipping/', $include_modules[$i]['file'], 'false');
          $module_file = DIR_FS_CATALOG . $module_file;
        } else {
        $lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/shipping/', $include_modules[$i]['file'], 'false');
        }

[20-Mar-2018 13:50:06 America/Los_Angeles] PHP Warning: include_once(includes/modules/shipping/canadapost.php): failed to open stream: No such file or directory in /home/xxx/public_html/includes/classes/shipping.php on line 64
[20-Mar-2018 13:50:06 America/Los_Angeles] PHP Warning: include_once(): Failed opening 'includes/modules/shipping/canadapost.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/xxx/public_html/includes/classes/shipping.php on line 64
[20-Mar-2018 13:50:06 America/Los_Angeles] PHP Fatal error: Class 'canadapost' not found in /home/xxx/public_html/includes/classes/shipping.php on line 65

20 Mar 2018, 11:51 PM
#1282
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Edit Orders v4.0 Support Thread

s-thomas:

Hi there

I just installed the module and am running into an issue that I have tracked down to the (IS_ADMIN_FLAG === true) in the /includes/classes/shipping file.
I am using Edit orders 4.1.7 and running Zen Cart 1.5.4

In the admin section the pages are not loading because of an file load error. If I hack the IS_ADMIN_FLAG then the pages loads with out errors. I am going with the assumption that there is an issue with the admin files calling the catalog files or that there is an issue with using a shipping file that is a core 1.5.5a when I am running 1.5.4. Any help would be appreciated.
Thanks

if (IS_ADMIN_FLAG === true) {
$lang_file = zen_get_file_directory(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/shipping/', $include_modules[$i]['file'], 'false');
$module_file = DIR_FS_CATALOG . $module_file;
} else {
$lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/shipping/', $include_modules[$i]['file'], 'false');
}

> 
> 
> [20-Mar-2018 13:50:06 America/Los_Angeles] PHP Warning:  include_once(includes/modules/shipping/canadapost.php): failed to open stream: No such file or directory in /home/xxx/public_html/includes/classes/shipping.php on line 64
> [20-Mar-2018 13:50:06 America/Los_Angeles] PHP Warning:  include_once(): Failed opening 'includes/modules/shipping/canadapost.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/xxx/public_html/includes/classes/shipping.php on line 64
> [20-Mar-2018 13:50:06 America/Los_Angeles] PHP Fatal error:  Class 'canadapost' not found in /home/xxx/public_html/includes/classes/shipping.php on line 65
First question: does this file exist? Warning:  include_once(includes/modules/shipping/canadapost.php): failed to open stream: No such file or directory

There may be some database remnant that is causing this issue.
21 Mar 2018, 4:22 PM
#1283
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

...make the change highlighted below:

                        // Adjust the product information based upon the
                        // data found in update_products
                        $new_product = array_merge([B]$product_update, $new_product[/B]);
> The issue is that the updated line was resulting in the previous product ($product_update) information (most importantly, the calculated price) was overwriting the newly-calculated price!
> 
> I'll get this issue (and the correction) up on the EO GitHub site, noting that the issue has been around since at least v4.1.5!  Thanks for the catch.


*array-merge* "merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array. If the input arrays have the same string keys, then the **later value for that key will overwrite the previous one**"

(source: <http://php.net/manual/en/function.array-merge.php>)

$new_product must be overwritten by $product_update (but not vice versa - as exactly $product_update contains information about new price got from $_POST)

Thus, why the previous version is not correct ??

                        // Adjust the product information based upon the
                        // data found in update_products
                        $new_product = array_merge($new_product, $product_update);

(I have got issue with price update exactly with latest code version, but never with previous...)
21 Mar 2018, 4:31 PM
#1284
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

yesaul:

array-merge "merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array. If the input arrays have the same string keys, then the later value for that key will overwrite the previous one"

(source: http://php.net/manual/en/function.array-merge.php)

$new_product must be overwritten by $product_update (but not vice versa - as exactly $product_update contains information about new price got from $_POST)

Thus, why the previous version is not correct ??

                        // Adjust the product information based upon the
                        // data found in update_products
                        $new_product = array_merge($new_product, $product_update);
> 
> (I have got issue with price update exactly with latest code version, but never with previous...)
I understand how array_merge works:smile:; unfortunately, the solution for the previous issue presented (i.e. that updated attributes' pricing wasn't being honored) required that the $new_product information (that includes that updated pricing) overwrite the values entered on the form ... resulting in the issue you've identified.

It looks like EO will need to record (in hidden inputs) the initial price displayed for each product and, if that price is updated, use the entered price instead of re-calculating.
21 Mar 2018, 4:46 PM
#1285
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

FWIW, I've created this GitHub issue to discuss and track the above change.

21 Mar 2018, 4:48 PM
#1286
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

I understand how array_merge works:smile:;
Thank you for prompt reply.
I'm pretty sure, you understand how array_merge works, but I haven't been sure if I do too...

To my happiness, I do not use products with attributes.

And is seems, for people like me the previous version of code is correct, but not new.

21 Mar 2018, 4:57 PM
#1287
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

yesaul:

Thank you for prompt reply.
I'm pretty sure, you understand how array_merge works, but I haven't been sure if I do too...

To my happiness, I do not use products with attributes.

And is seems, for people like me the previous version of code is correct, but not new.
Until I think this through for the general case, you should reverse the order of that array_merge statement to its previous version:

$new_product = array_merge($new_product, $product_update);

... so that the values from the form ($product_update) overwrite the new calculations ($new_product).

22 Mar 2018, 5:42 PM
#1288
s_thomas avatar

s_thomas

New Zenner

Join Date:
Oct 2015
Posts:
5
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Yes the file exists. If I set the IS_ADMIN_FLAG to true everything works fine.

22 Mar 2018, 5:44 PM
#1289
s_thomas avatar

s_thomas

New Zenner

Join Date:
Oct 2015
Posts:
5
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

s-thomas:

Hi there

I just installed the module and am running into an issue that I have tracked down to the (IS_ADMIN_FLAG === true) in the /includes/classes/shipping file.
I am using Edit orders 4.1.7 and running Zen Cart 1.5.4

In the admin section the pages are not loading because of an file load error. If I hack the IS_ADMIN_FLAG then the pages loads with out errors. I am going with the assumption that there is an issue with the admin files calling the catalog files or that there is an issue with using a shipping file that is a core 1.5.5a when I am running 1.5.4. Any help would be appreciated.
Thanks

if (IS_ADMIN_FLAG === true) {
$lang_file = zen_get_file_directory(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/shipping/', $include_modules[$i]['file'], 'false');
$module_file = DIR_FS_CATALOG . $module_file;
} else {
$lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/shipping/', $include_modules[$i]['file'], 'false');
}

> 
> 
> [20-Mar-2018 13:50:06 America/Los_Angeles] PHP Warning:  include_once(includes/modules/shipping/canadapost.php): failed to open stream: No such file or directory in /home/xxx/public_html/includes/classes/shipping.php on line 64
> [20-Mar-2018 13:50:06 America/Los_Angeles] PHP Warning:  include_once(): Failed opening 'includes/modules/shipping/canadapost.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/xxx/public_html/includes/classes/shipping.php on line 64
> [20-Mar-2018 13:50:06 America/Los_Angeles] PHP Fatal error:  Class 'canadapost' not found in /home/xxx/public_html/includes/classes/shipping.php on line 65

@mc12345678  Yes the file exists. If I set the IS_ADMIN_FLAG to true everything works fine.
23 Mar 2018, 2:07 AM
#1290
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

1.5.5f
Super Orders 10K, Edit Orders 4.3.3, Ty-Package Tracker 3.1.5
PHP 5.6, only because Super Orders doesn't support 7 and above yet/ever...lol

I'm at a bit of a loss as everything has been working fine on our site until earlier today.
We updated to EditOrders 4.3.3, cleaned up SO code and got Ty Package Tracker working again 2 weeks ago and everything has been working great
Until earlier today when I suddenly began getting Admin Debug Logs complaining about some code in Admin/orders.php and the EditOrders screen stopped updating line items when I made changes and clicked on "Update"
mc12345678 helped me through the DeBug log issue, thank you very much, by supplying me with a couple of code changes to the SO code in admin/orders.php and admin/super_data_sheet.php, but I am still fighting the no update issue.
If I go to EditOrders from the SuperOrder's Order page, change the price of a line item and click "Update" the system acts like it is doing something, the screen refreshes and the changes I made are converted back to the original entry but no DeBug files are generated as if there was no error.

I'm starting to wonder if I should remove Super Orders but I really need the Split Order and payment functions.

Any assistance would be greatly appreciated

23 Mar 2018, 2:44 AM
#1291
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

wsworx:

1.5.5f
Super Orders 10K, Edit Orders 4.3.3, Ty-Package Tracker 3.1.5
PHP 5.6, only because Super Orders doesn't support 7 and above yet/ever...lol

I'm at a bit of a loss as everything has been working fine on our site until earlier today.
We updated to EditOrders 4.3.3, cleaned up SO code and got Ty Package Tracker working again 2 weeks ago and everything has been working great
Until earlier today when I suddenly began getting Admin Debug Logs complaining about some code in Admin/orders.php and the EditOrders screen stopped updating line items when I made changes and clicked on "Update"
mc12345678 helped me through the DeBug log issue, thank you very much, by supplying me with a couple of code changes to the SO code in admin/orders.php and admin/super_data_sheet.php, but I am still fighting the no update issue.
If I go to EditOrders from the SuperOrder's Order page, change the price of a line item and click "Update" the system acts like it is doing something, the screen refreshes and the changes I made are converted back to the original entry but no DeBug files are generated as if there was no error.

I'm starting to wonder if I should remove Super Orders but I really need the Split Order and payment functions.

Any assistance would be greatly appreciated

I enabled EOs debug feature and attached the file here if that will help.Attachment #17754

23 Mar 2018, 3:20 AM
#1292
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Edit Orders v4.0 Support Thread

wsworx:

1.5.5f
Super Orders 10K, Edit Orders 4.3.3, Ty-Package Tracker 3.1.5
PHP 5.6, only because Super Orders doesn't support 7 and above yet/ever...lol

I'm at a bit of a loss as everything has been working fine on our site until earlier today.
We updated to EditOrders 4.3.3, cleaned up SO code and got Ty Package Tracker working again 2 weeks ago and everything has been working great
Until earlier today when I suddenly began getting Admin Debug Logs complaining about some code in Admin/orders.php and the EditOrders screen stopped updating line items when I made changes and clicked on "Update"
mc12345678 helped me through the DeBug log issue, thank you very much, by supplying me with a couple of code changes to the SO code in admin/orders.php and admin/super_data_sheet.php, but I am still fighting the no update issue.
If I go to EditOrders from the SuperOrder's Order page, change the price of a line item and click "Update" the system acts like it is doing something, the screen refreshes and the changes I made are converted back to the original entry but no DeBug files are generated as if there was no error.

I'm starting to wonder if I should remove Super Orders but I really need the Split Order and payment functions.

Any assistance would be greatly appreciated
Although lat9 has temporarily reversed the suggestion of Post 1271, curious if that revision resolves the issue.

23 Mar 2018, 3:24 AM
#1293
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Edit Orders v4.0 Support Thread

s-thomas:

@mc12345678 Yes the file exists. If I set the IS_ADMIN_FLAG to true everything works fine.
This is unusual and not fully clarified. The IS_ADMIN_FLAG has been part of ZC for some time and as edit_orders is run from the admin, the value should already be true it seems (haven't reviewed the code to validate/contradict that theory). Where in the code is this "new" setting being applied and is it something that is not properly managed in the problem shipping module?

23 Mar 2018, 10:37 AM
#1294
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

mc12345678:

Although lat9 has temporarily reversed the suggestion of Post 1271, curious if that revision resolves the issue.
As a distinction, what I said was that for people who want to have control over the price (as opposed to having it re-calculated) that the reversion back will resolve that issue.

23 Mar 2018, 2:15 PM
#1295
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

Edit Orders v4.3.4-beta2 is now available (https://github.com/lat9/edit_orders/releases/tag/v4.3.4-beta2) for those that want a pre-check.

That version (to be released as v4.3.4) now includes two additional configuration settings to allow a store to identify how product-price calculations should be handled. Those new settings are described in this GitHub issue: https://github.com/lat9/edit_orders/issues/75

23 Mar 2018, 4:20 PM
#1296
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

mc12345678:

Although lat9 has temporarily reversed the suggestion of Post 1271, curious if that revision resolves the issue.

I'm still mystified by all this as everything was running great and the boom out of no where this stuff starts.

I went back as you suggested and changed it back to the original setup and it is now working.....lol.

23 Mar 2018, 5:37 PM
#1297
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

wsworx:

I'm still mystified by all this as everything was running great and the boom out of no where this stuff starts.

I went back as you suggested and changed it back to the original setup and it is now working.....lol.
Everything was running great for *your *setup; other stores (where attributes' pricing was in effect) were ***not ***previously working. The v4.3.4-beta2 update recognizes those setup differences, which I hadn't accounted for in the EO 4.3.3 update.

23 Mar 2018, 5:46 PM
#1298
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

Everything was running great for *your *setup; other stores (where attributes' pricing was in effect) were ***not ***previously working. The v4.3.4-beta2 update recognizes those setup differences, which I hadn't accounted for in the EO 4.3.3 update.

All I can say is it is a great PlugIn and I, as well as many others I am sure, can't thank you enough for your hard work and dedication.

8 Apr 2018, 1:22 PM
#1299
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

I've just submitted v4.3.4 of Edit Orders to the Zen Cart Plugins for review; once available for download, I'll post back here.

This release contains changes associated with the following GitHub issues, see https://github.com/lat9/edit_orders for additional information:

#65: Enable ot_onetime_discount to both add to and deduct from an order's total.
#72: Additional notifications for plugin support.
#73: Tax-handling corrections, enables proper integration with plugin order-totals.
#74: Correct PHP 7.1+ warning
#75: Entered product price no longer overrides calculations. In support of that change, two additional Edit Orders configuration settings are created!
#76: Changes to the order's shipping method don't "stick".
#77: Re-align /YOUR_ADMIN/orders.php notifiers with those present in Zen Cart 1.5.6 and later.

13 Apr 2018, 4:35 PM
#1300
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

lat9:

I've just submitted v4.3.4 of Edit Orders to the Zen Cart Plugins for review; once available for download, I'll post back here.

This release contains changes associated with the following GitHub issues, see https://github.com/lat9/edit_orders for additional information:

#65: Enable ot_onetime_discount to both add to and deduct from an order's total.
#72: Additional notifications for plugin support.
#73: Tax-handling corrections, enables proper integration with plugin order-totals.
#74: Correct PHP 7.1+ warning
#75: Entered product price no longer overrides calculations. In support of that change, two additional Edit Orders configuration settings are created!
#76: Changes to the order's shipping method don't "stick".
#77: Re-align /YOUR_ADMIN/orders.php notifiers with those present in Zen Cart 1.5.6 and later.
Now available for download from the Zen Cart plugins: https://www.zen-cart.com/downloads.php?do=file&id=1513