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

Edit Orders v4.0 Support Thread

Views: 346,083

Results 1,621 to 1,640 of 1,927
4 Dec 2020, 12:11 PM
#1621
lat9 avatar

lat9

Administrator

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

Edit Orders v4.0 Support Thread

I've just submitted v4.5.5 of Edit Orders for the Zen Cart moderators' review; I'll post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#178: Update order/product weight fields for zc156 and later when adding/updating.
#179: Update product's addition notification to include the SQL data array.
#180: Display "Total Price" as the gross price when the store displays prices with tax.

4 Dec 2020, 8:48 PM
#1622
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

lat9:

I've just submitted v4.5.5 of Edit Orders for the Zen Cart moderators' review; I'll post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#178: Update order/product weight fields for zc156 and later when adding/updating.
#179: Update product's addition notification to include the SQL data array.
#180: Display "Total Price" as the gross price when the store displays prices with tax.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=1513

21 Dec 2020, 4:24 PM
#1623
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Re: Edit Orders v4.0 Support Thread

hi,
i'm trying to understand the reset_totals checkbox. in what situation would want to use the checkbox v not to use the checkbox.

i'm getting some PHP notices when it is not checked, as somehow the orders_totals array has a missing element, ie there are 6 elements to the array, numbered from 0-6, with index 2 missing.

in addition, when i look at that array, there is an element for ot_tax and yet ot_tax is not enabled in my orders_totals modules. so is that somehow hard coded?

but i really would like to understand why that reset_totals is there.

thanks in advance.

21 Dec 2020, 4:29 PM
#1624
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

That "Reset Totals" checkbox is a way to kick EO in the arse and have it "do-over" the totals. Sometimes the order_total/order_tax element(s) in the base orders table get out-of-sync with the values recorded in the orders_total table.

21 Dec 2020, 4:57 PM
#1625
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Re: Edit Orders v4.0 Support Thread

lat9:

That "Reset Totals" checkbox is a way to kick EO in the arse and have it "do-over" the totals. Sometimes the order_total/order_tax element(s) in the base orders table get out-of-sync with the values recorded in the orders_total table.

so there is no harm with having it always checked, and ignoring it when not checked? ie the only penalty is a little processing time and perhaps some DB hits?

i have tracked down this bug to ot_tax. ot_tax is hard coded into EO. if you have a store that does NOT make use of the ot_tax orders total module, and you do not have the checkbox checked, you will get PHP notices as such:

[08:10:05 US/Great_State_of_Los_Angeles] PHP Notice:  Undefined offset: 2 in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 1499
[08:10:05 US/Great_State_of_Los_Angeles] PHP Notice:  Trying to access array offset on value of type null in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 1499
[08:10:05 US/Great_State_of_Los_Angeles] PHP Notice:  Undefined offset: 2 in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 1500
[08:10:05 US/Great_State_of_Los_Angeles] PHP Notice:  Trying to access array offset on value of type null in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 1500
[08:10:05 US/Great_State_of_Los_Angeles] PHP Notice:  Undefined offset: 2 in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 1505
[08:10:05 US/Great_State_of_Los_Angeles] PHP Notice:  Trying to access array offset on value of type null in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 1505
[08:10:05 US/Great_State_of_Los_Angeles] PHP Notice:  Undefined offset: 2 in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 1509
[08:10:05 US/Great_State_of_Los_Angeles] PHP Notice:  Trying to access array offset on value of type null in /admin/includes/functions/extra_functions/edit_orders_functions.php on line 1509

i believe i am using the latest version with an alpha or beta designation (call me a radical), and 1499 corresponds to here:

https://github.com/lat9/edit_orders/blob/7c2099634a854cce2d2c35ec69bf3ae4afe4b8d8/YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php#L1499

personally, i am not a fan of hard coding anything (despite doing it all the time); but if i can override that checkbox to have it always checked using your provided observer with no ill effect, that's fine with me.

thanks in advance!

21 Dec 2020, 5:32 PM
#1626
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

@carlwhat, I'll give that a look-see over the next week.

Update: What is it that's removing element [2] from that array without re-indexing?

21 Dec 2020, 6:03 PM
#1627
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Re: Edit Orders v4.0 Support Thread

lat9:

@carlwhat, I'll give that a look-see over the next week.

Update: What is it that's removing element [2] from that array without re-indexing?

:thumbsup:

with regards to your update, i suppose that is the million $ question.

i have yet to dig in any further than i have already posted.

21 Dec 2020, 6:17 PM
#1628
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

carlwhat:

:thumbsup:

with regards to your update, i suppose that is the million $ question.

i have yet to dig in any further than i have already posted.
Do I get the million or do I have to pay when you get that answer?:P

P.S. You're a radical!

21 Dec 2020, 7:27 PM
#1629
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Re: Edit Orders v4.0 Support Thread

lat9:

P.S. You're a radical!

gee thanks.

this is the code that is removing the index:

// Process the order totals
        $order_totals = $GLOBALS['order_total_modules']->process();

in fact it is not removing it, it is re-arranging it.

it looks like the problem resides elsewhere; in the tax module that the client uses.

thanks for the help.

guess the million will now have to go unclaimed!

:P

22 Dec 2020, 1:53 PM
#1630
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

carlwhat:

gee thanks.

this is the code that is removing the index:

// Process the order totals
$order_totals = $GLOBALS['order_total_modules']->process();

> 
> in fact it is not removing it, it is re-arranging it.
> 
> it looks like the problem resides elsewhere; in the tax module that the client uses.
> 
> thanks for the help.  
> 
> guess the million will now have to go unclaimed!
> 
> :P
@carlwhat, I believe that I can provide a work-around for the issue you've identified (order_totals not re-indexed after removal).  I could use a foreach loop instead of a for-loop to prevent those 'missing indices' notices.
22 Dec 2020, 2:59 PM
#1631
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Re: Edit Orders v4.0 Support Thread

lat9:

@carlwhat, I believe that I can provide a work-around for the issue you've identified (order_totals not re-indexed after removal). I could use a foreach loop instead of a for-loop to prevent those 'missing indices' notices.

@lat9, thanks for the help in pinpointing where the problem might be as well as thinking about solutions. i want to be clear about what is happening, prior to you making a determination as to what you may want to do.

i think i was incorrect in my expression of what the tax module did in my last post. it is not a rearrangement as i suggested; it removes its element (in all observed cases, that was element [2]), and then adds a new one to the end of the array. i have now modified that code to use the removed index if removed, or just add it to the end of the array if not removed (loving the new coalesce operator in php7+). that seems to have addressed the problem with no ill consequences that i have seen.

in addition, i am still unclear if one can safely remove the reset_totals checkbox from user choice with no ill consequences. i initially did that approach (using the observer which again addressed the issue), and again with no ill consequences. i understand a bit of a processing penalty; but i can easily live with that.

i also think there are shops out there that may experience this problem, that if it can be solved within EO, it would be of value. not every shop will have the IT techno expertise to figure this out, and as php progresses i think some of these notices could turn into warnings, then errors, etc.

i can test your solution later today if you would like. i would hesitate for you to commit to anything un-tested; and unless you are so inclined to set up your env to mimic this behavior, i could easily do it later today.

best.

22 Dec 2020, 10:34 PM
#1632
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Re: Edit Orders v4.0 Support Thread

@lat9, tested and seems to work.

seems like a good approach.

thanks.

23 Dec 2020, 12:49 PM
#1633
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

carlwhat:

@lat9, tested and seems to work.

seems like a good approach.

thanks.
... and thanks back to you for the validation. I thought that I'd gone through and changed those for() loops to foreach() wherever there wasn't a possible need to update a loop-element. I'll go through EO's processing to make sure that I've 'hit' all those!

4 Jan 2021, 11:04 AM
#1634
markau avatar

markau

New Zenner

Join Date:
Oct 2020
Location:
australia
Posts:
31
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Just installed today on my zen cart 1.5.7 (1.5.7, not 1.5.7a or 1.5.7b). I found that the subtotal does not change at all no matter how I add or remove products. But after I removed all the products, and then add new products to the order, all the calculation becomes right. It seems that the products already in the order are ignored in calculation

Another problem is: when I use "reset totals prior to update", subtotal becomes 0, and does not change anymore, no matter how I add/remove products

Really strange...

4 Jan 2021, 11:51 AM
#1635
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

markau:

Just installed today on my zen cart 1.5.7 (1.5.7, not 1.5.7a or 1.5.7b). I found that the subtotal does not change at all no matter how I add or remove products. But after I removed all the products, and then add new products to the order, all the calculation becomes right. It seems that the products already in the order are ignored in calculation

Another problem is: when I use "reset totals prior to update", subtotal becomes 0, and does not change anymore, no matter how I add/remove products

Really strange...
Not so strange ... zc157 (no alpha-suffix) has a critical flaw for any plugin that makes use of the notify/observe infrastructure of Zen Cart (like Edit Orders). Update your zc157 code base to zc157b or, at a minimum, update to use the known bugs in the zc157 series (https://www.zen-cart.com/showthread.php?226872-Known-bugs-%28and-fixes%29-for-v1-5-7-series%29.

4 Jan 2021, 12:45 PM
#1636
markau avatar

markau

New Zenner

Join Date:
Oct 2020
Location:
australia
Posts:
31
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

Not so strange ... zc157 (no alpha-suffix) has a critical flaw for any plugin that makes use of the notify/observe infrastructure of Zen Cart (like Edit Orders). Update your zc157 code base to zc157b or, at a minimum, update to use the known bugs in the zc157 series (https://www.zen-cart.com/showthread.php?226872-Known-bugs-%28and-fixes%29-for-v1-5-7-series%29.

Many thanks for your instructions. I updated the minimum, no effect. I already installed too many plugins so full update would be too painful. I give up.

4 Jan 2021, 2:13 PM
#1637
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

markau:

Many thanks for your instructions. I updated the minimum, no effect. I already installed too many plugins so full update would be too painful. I give up.
Any clues as to those 'other' plugins would certainly help in diagnosing your issue.

5 Jan 2021, 8:59 PM
#1638
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,689
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

Would it be possible to permit negative quantities to be used with the "Add Product" button, as a way of doing returns and exchanges?

6 Jan 2021, 1:23 PM
#1639
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

swguy:

Would it be possible to permit negative quantities to be used with the "Add Product" button, as a way of doing returns and exchanges?
You could create a change request on EO's GitHub repo (https://github.com/lat9/edit_orders), but since that's not a 'mainstream' usage it'll be a while before that change is incorporated into the EO distribution.