Page 1 of 2 12 LastLast
Results 1 to 10 of 1920

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default 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.

  2. #2
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    568
    Plugin Contributions
    0

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lat9 View Post
    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.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by marton_1 View Post
    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.

  4. #4
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    568
    Plugin Contributions
    0

    Default Re: Edit Orders v4.0 Support Thread

    Wow, that was a lightning quick fix

    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

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by marton_1 View Post
    Wow, that was a lightning quick fix

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

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default 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.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lat9 View Post
    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 View Post
    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

  8. #8
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    71
    Plugin Contributions
    0

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lat9 View Post
    ...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...)

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by yesaul View Post
    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...)
    I understand how array_merge works; 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.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default Re: Edit Orders v4.0 Support Thread

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

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Super Orders v4.0 Support Thread for ZC v1.5.x
    By DivaVocals in forum Addon Admin Tools
    Replies: 818
    Last Post: 9 Jul 2026, 10:12 AM
  2. v150 Orders Status History -- Updated By [Support Thread]
    By lat9 in forum Addon Admin Tools
    Replies: 34
    Last Post: 29 Jul 2019, 07:05 PM
  3. Edit Orders v3.0 for ZC 1.3.9 [Support Thread]
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 656
    Last Post: 18 Apr 2016, 06:28 PM
  4. v139h Super Orders v3.0 Support Thread (for ZC v1.3.9)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1018
    Last Post: 28 Apr 2014, 11:38 PM
  5. RE: Super Orders v3.0 Support Thread
    By Johnnyd in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 22 Jun 2011, 09:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg