Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
marton_1
OK great, sorry to make work.
You're not making work, you're helping to improve EO.
Look in your store's /admin/edit_orders.php, finding the following code section at around line 388:
Code:
// Handle the case where the product was deleted
// from the store. This should probably never be done.
// Removing the product will cause issues with links
// on invoices (order history) and will not allow the
// price(s) or tax(es) to be recalculated by Zen Cart.
if (!isset($new_product['price'])) {
$new_product['price'] = $old_product['price'];
$new_product['tax'] = $old_product['tax'];
if ($new_product['tax'] > 0) {
// Should match what is set by eo_get_product_taxes()
// When no description is present in the database but
// a tax rate exists on a product.
$new_product['tax_description'] = TEXT_UNKNOWN_TAX_RATE . ' (' . zen_display_tax_value($new_product['tax']) . '%)';
}
$new_product['products_discount_type'] = $old_product['products_discount_type'];
$new_product['products_discount_type_from'] = $old_product['products_discount_type_from'];
$new_product['products_priced_by_attribute'] = $old_product['products_priced_by_attribute'];
$new_product['product_is_free'] = $old_product['product_is_free'];
}
// Adjust the product information based upon the
// data found in update_products
$new_product = array_merge($new_product, $product_update);
and make the change highlighted below:
Code:
// Handle the case where the product was deleted
// from the store. This should probably never be done.
// Removing the product will cause issues with links
// on invoices (order history) and will not allow the
// price(s) or tax(es) to be recalculated by Zen Cart.
if (!isset($new_product['price'])) {
$new_product['price'] = $old_product['price'];
$new_product['tax'] = $old_product['tax'];
if ($new_product['tax'] > 0) {
// Should match what is set by eo_get_product_taxes()
// When no description is present in the database but
// a tax rate exists on a product.
$new_product['tax_description'] = TEXT_UNKNOWN_TAX_RATE . ' (' . zen_display_tax_value($new_product['tax']) . '%)';
}
$new_product['products_discount_type'] = $old_product['products_discount_type'];
$new_product['products_discount_type_from'] = $old_product['products_discount_type_from'];
$new_product['products_priced_by_attribute'] = $old_product['products_priced_by_attribute'];
$new_product['product_is_free'] = $old_product['product_is_free'];
}
// Adjust the product information based upon the
// data found in update_products
$new_product = array_merge($product_update, $new_product);
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.
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
marton_1
OK great, sorry to make work.
I did not even notice that! Thank you! Fix seems to do the trick.
Re: Edit Orders v4.0 Support Thread
Wow, that was a lightning quick fix :smile: :clap:
Works great!
"been around since at least v4.1.5" LOL!
Sorry for my delay in replying, I had an unrelated customer problem.
I really must learn PHP. I had my first computer programming job 55 years ago but I have some sort of internal resistance to learning modern computer languages that do not require me to write some pages of definitions before I even start coding :D
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
marton_1
Wow, that was a lightning quick fix :smile: :clap:
Works great!
"been around since at least v4.1.5" LOL!
Sorry for my delay in replying, I had an unrelated customer problem.
I really must learn PHP. I had my first computer programming job 55 years ago but I have some sort of internal resistance to learning modern computer languages that do not require me to write some pages of definitions before I even start coding :D
Thanks for the report back ... customer issues always take first priority!
I still remember the first time I was introduced to C code and thinking "How could anyone ever figure out that funkiness?".
Re: Edit Orders v4.0 Support Thread
I've just submitted v4.3.3 of EO to the Zen Cart plugins for review and will post back here, once it's available. This release contains changes associated with the following issues, as identified by the GitHub issue number from https://github.com/lat9/edit_orders:
#67: Display message if insufficient product quantity is available.
#70: Product's price not updated if attributes changed.
#71: Align "notifications" with Zen Cart 1.5.6 and later.
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
I've just submitted v4.3.2 of EO to the Zen Cart plugins for review, containing changes associated with the following GitHub issues:
#66: Load EO functions only for EO's use.
#68: Log-file formatting updates.
#69: Attributes "lost" from ordered products when an order is updated.
See
https://github.com/lat9/edit_orders for details. I'll post back here when it's available for download from the ZC Plugins.
Quote:
Originally Posted by
lat9
I've just submitted v4.3.3 of EO to the Zen Cart plugins for review and will post back here, once it's available. This release contains changes associated with the following issues, as identified by the GitHub issue number from
https://github.com/lat9/edit_orders:
#67: Display message if insufficient product quantity is available.
#70: Product's price not updated if attributes changed.
#71: Align "notifications" with Zen Cart 1.5.6 and later.
EO v4.3.3 (containing the above changes) is now available for download from the Zen Cart plugins: https://www.zen-cart.com/downloads.php?do=file&id=1513
Re: Edit Orders v4.0 Support Thread
I've got EO v4.3.4-beta1 available if anyone wants an early peek: https://github.com/lat9/edit_orders/...g/v4.3.4-beta1
That version currently contains changes associated with the following GitHub issues:
#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
Please note that change#73 could be disruptive for stores using Quantity Discounts. I've validated the integration using v1.12 of that plugin, with the edit suggested by this posting in the QD support thread.
Unless I hear of issues, I'll be packaging this up as v4.3.4 of EO later in the week.
Re: 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
Code:
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
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
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
Code:
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.
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
...make the change highlighted below:
Code:
// Adjust the product information based upon the
// data found in update_products
$new_product = array_merge($product_update, $new_product);
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 ??
Code:
// 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...)