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

Edit Orders v4.0 Support Thread

Views: 346,060

Results 1,261 to 1,280 of 1,927
7 Mar 2018, 2:26 PM
#1261
lat9 avatar

lat9

Administrator

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

Edit Orders v4.0 Support Thread

mc12345678:

To be clear, the highlighted portion does not fully occur. The "product" itself remains, but the attributes associated are removed. Permanently. They can be "added" back in only if the product is added with the associated attributes (costs and other characteristics), but an update from the current page (whether adjusting the attributes or not) plain removes attributes from all product whether the product was edited or not.

Seeing that little has/had changed in the base "direction" to remove and add product's to the order, my search led me to consider other "black boxes" with current review of the admin's attributes class because of the breadth of changes that were made between the current version and a version that I could readily identify as previously working (4.1.7). (I know a long time ago. :) ).
Well, :censored:. I've noted the issue on GitHub and address it over the weekend.

7 Mar 2018, 5:59 PM
#1262
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:

Well, :censored:. I've noted the issue on GitHub and address it over the weekend.
OK, as usual, this was bugging me (no pun intended).

The change (currently up on EO's GitHub repository) involves a teeny change to use the correct:blush: variable name.

In /YOUR_ADMIN/edit_orders.php, find the following section (around line 377):

                        if ($product_update['qty'] > 0) {

                            // Retrieve the information for the new product
                            $attrs = (isset($product_update['attr'])) ? $product_info['attr'] : '';
                            unset($product_update['attr']);
                            $new_product = eo_get_new_product(
                                $old_product['id'],
                                $product_update['qty'],
                                $attrs,
                                false
                            );
                            unset($attrs);

and make the highlighted change:

                        if ($product_update['qty'] > 0) {

                            // Retrieve the information for the new product
                            $attrs = (isset($product_update['attr'])) ? $[B]product_update[/B]['attr'] : '';
                            unset($product_update['attr']);
                            $new_product = eo_get_new_product(
                                $old_product['id'],
                                $product_update['qty'],
                                $attrs,
                                false
                            );
                            unset($attrs);
7 Mar 2018, 6:34 PM
#1263
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Edit Orders v4.0 Support Thread

Certainly looks like that will fix it. (Note, there appear to be other "notice" related items to address besides what was done for that line.)

7 Mar 2018, 6:50 PM
#1264
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:

Certainly looks like that will fix it. (Note, there appear to be other "notice" related items to address besides what was done for that line.)
I'm sure there are; I'm holding off for the re-design to address those.

7 Mar 2018, 10:18 PM
#1265
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.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.

8 Mar 2018, 2:46 PM
#1266
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

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.

Thank you for addressing this. The last piece of the puzzle for us to go live with 155f.

8 Mar 2018, 3:00 PM
#1267
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

athena:

Thank you for addressing this. The last piece of the puzzle for us to go live with 155f.
No problems, thanks to you and @mc12345678 for identifying the issue ... it's hard to fix something I don't know about!

8 Mar 2018, 3:30 PM
#1268
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

athena:

Thank you for addressing this. The last piece of the puzzle for us to go live with 155f.

I just installed the latest edit order code with this fix included on my test server with 155f.
I can edit attributes OK and the attribute description changes OK but the associated price does not change! Probably I did something wrong somewhere, I just wondered if the price change works OK for you before I start digging into my update?

The older version of edit order works fine on my production server with 155e.

8 Mar 2018, 3:51 PM
#1269
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

marton_1:

I just installed the latest edit order code with this fix included on my test server with 155f.
I can edit attributes OK and the attribute description changes OK but the associated price does not change! Probably I did something wrong somewhere, I just wondered if the price change works OK for you before I start digging into my update?

The older version of edit order works fine on my production server with 155e.
How is that product defined? What types of attributes (e.g. radio, dropdown) are you using? Is the product priced by attributes?

I'll try to replicate the issue, but those answers will save me some time.

8 Mar 2018, 3:59 PM
#1270
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

How is that product defined? What types of attributes (e.g. radio, dropdown) are you using? Is the product priced by attributes?

I'll try to replicate the issue, but those answers will save me some time.

Apologise in advance if it turns out to be my finger trouble.

The product has a base price and larger sizes have an add-on price.

The size attribute is a drop down.

Here is a link to the live product, best way to answer your question?

Thanks in advance

English language here

8 Mar 2018, 4:11 PM
#1271
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

I also tried with and without "Reset totals prior to update? " set.

8 Mar 2018, 4:11 PM
#1272
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

Thanks, I was able to replicate the issue locally. I'll report back when I've found the source of the issue.

8 Mar 2018, 4:14 PM
#1273
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

Thanks, I was able to replicate the issue locally. I'll report back when I've found the source of the issue.

OK great, sorry to make work.

8 Mar 2018, 5:15 PM
#1274
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

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:

                            
                            // 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:

                            
                            // 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([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.

8 Mar 2018, 6:25 PM
#1275
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

marton_1:

OK great, sorry to make work.

I did not even notice that! Thank you! Fix seems to do the trick.

8 Mar 2018, 9:11 PM
#1276
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

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

8 Mar 2018, 9:48 PM
#1277
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

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?".

9 Mar 2018, 8:43 PM
#1278
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.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.

12 Mar 2018, 2:44 PM
#1279
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.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.

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

19 Mar 2018, 6:47 PM
#1280
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 got EO v4.3.4-beta1 available if anyone wants an early peek: https://github.com/lat9/edit_orders/releases/tag/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.