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

Edit Orders v4.0 Support Thread

Views: 346,076

Results 1,561 to 1,580 of 1,927
22 Jun 2020, 11:35 AM
#1561
lat9 avatar

lat9

Administrator

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

Edit Orders v4.0 Support Thread

swguy:

admin/includes/classes/editOrders.php lines 270, 274: should $this->shipping_tax_rate be cast as a float in case it's null?
(Getting SQL error on line 270)
It's taken a long time to get all those other float-casts out of EO (trying to get rid of those penny-off calculations), but I'll update this section of the class' *initializeOrderShippingTax *method:

        switch ($action) {
            case 'update_order':
                [B]$this->shipping_tax_rate = $_POST['shipping_tax'];[/B]
                $order->info['shipping_tax'] = $this->calculateOrderShippingTax(true);
                break;
            case 'add_prdct':
                $this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
                $order->info['shipping_tax'] = $this->eoRoundCurrencyValue(zen_calculate_tax($order->info['shipping_cost'], $this->shipping_tax_rate));
                break;
            default:
                $this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
                $order->info['shipping_tax'] = $this->calculateOrderShippingTax(false);
                break;
        }

to sanitize that value on entry.

See this GitHub issue for follow-on: https://github.com/lat9/edit_orders/issues/157

22 Jun 2020, 12:22 PM
#1562
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

As an alternative, you could not do the update when the value is null. But I'm ok with either solution. Thanks!

22 Jun 2020, 1:12 PM
#1563
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

lat9:

It's taken a long time to get all those other float-casts out of EO (trying to get rid of those penny-off calculations), but I'll update this section of the class' *initializeOrderShippingTax *method:

    switch ($action) {
        case 'update_order':
            [B]$this->shipping_tax_rate = $_POST['shipping_tax'];[/B]
            $order->info['shipping_tax'] = $this->calculateOrderShippingTax(true);
            break;
        case 'add_prdct':
            $this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
            $order->info['shipping_tax'] = $this->eoRoundCurrencyValue(zen_calculate_tax($order->info['shipping_cost'], $this->shipping_tax_rate));
            break;
        default:
            $this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
            $order->info['shipping_tax'] = $this->calculateOrderShippingTax(false);
            break;
    }
> to sanitize that value on entry.
> 
> See this GitHub issue for follow-on: <https://github.com/lat9/edit_orders/issues/157>
Update provided; see that issue for the change required.
22 Jun 2020, 1:17 PM
#1564
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

lat9:

Hmm, looks like you've got My Store::Show Split Tax Lines set to false. Let me investigate further.
The work-around for this issue is to update the above setting to true, so that each tax-type's value is recorded as a separate ot_tax order-total.

The underlying cause of the issue is that the order's shipping-tax's "Tax Group" isn't captured as part of the order's processing so that reconstructing the order's taxes when all the taxes are bundled into a single, overall value is 'difficult'.:(

22 Jun 2020, 1:24 PM
#1565
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

lat9:

The work-around for this issue is to update the above setting to true, so that each tax-type's value is recorded as a separate ot_tax order-total.

The underlying cause of the issue is that the order's shipping-tax's "Tax Group" isn't captured as part of the order's processing so that reconstructing the order's taxes when all the taxes are bundled into a single, overall value is 'difficult'.:(
GitHub issue created for tracking: https://github.com/lat9/edit_orders/issues/158

22 Jun 2020, 1:56 PM
#1566
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

lat9:

The underlying cause of the issue is that the order's shipping-tax's "Tax Group" isn't captured as part of the order's processing so that reconstructing the order's taxes when all the taxes are bundled into a single, overall value is 'difficult'.:(

I quite agree. Perhaps something involving LIKE (but perhaps excluding default strings like "Tax" or "Sales Tax"?) might work. I can see how this block was created in response to an edge case.

22 Jun 2020, 6:30 PM
#1567
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

swguy:

I quite agree. Perhaps something involving LIKE (but perhaps excluding default strings like "Tax" or "Sales Tax"?) might work. I can see how this block was created in response to an edge case.
It's actually not an edge case, that shipping-tax handling was created based on various uses where (as in your case) the tax on shipping is different than that associated with the various products in the order.

18 Jul 2020, 5:35 AM
#1568
johnniejetski2 avatar

johnniejetski2

New Zenner

Join Date:
Dec 2017
Location:
FLAH-DUH
Posts:
45
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Finally got around to trying to upgrade my site from 1.3.9h to the latest version, 1.5.7. Love Super Orders and Edit Orders. My Faves for sure. For some reason I cant get edit orders to work and Im thinking its a simple workaround, but I haven't found it yet. I get this error when trying to edit or delete an order

The store's zen_add_tax function must be updated to enable Edit Orders' use.

I see a file with the same name, but opening it did not provide any clues to how to remove it and I have been through every admin tab available with no luck...

My admin log has this message

#1 sizeof() called at [/admen/orders.php:1110]
#2 require(/admen/orders.php) called at [/admen/index.php:11]
--> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /admen/orders.php on line 1110.

Any idea how to squash this message and let edit orders do its work?

18 Jul 2020, 11:49 AM
#1569
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

johnniejetski2:

Finally got around to trying to upgrade my site from 1.3.9h to the latest version, 1.5.7. Love Super Orders and Edit Orders. My Faves for sure. For some reason I cant get edit orders to work and Im thinking its a simple workaround, but I haven't found it yet. I get this error when trying to edit or delete an order

The store's zen_add_tax function must be updated to enable Edit Orders' use.

I see a file with the same name, but opening it did not provide any clues to how to remove it and I have been through every admin tab available with no luck...

My admin log has this message

#1 sizeof() called at [/admen/orders.php:1110]
#2 require(/admen/orders.php) called at [/admen/index.php:11]
--> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /admen/orders.php on line 1110.

Any idea how to squash this message and let edit orders do its work?
Arggh, that's still not fixed in zc157? Anyway, the Installation :: Changes to zen_add_tax tab in the EO readme identifies the changes needed to the admin's /includes/functions/general.php that are required for EO to do its thing.

18 Jul 2020, 9:41 PM
#1570
johnniejetski2 avatar

johnniejetski2

New Zenner

Join Date:
Dec 2017
Location:
FLAH-DUH
Posts:
45
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

That definitely made it better, however when I went to DELETE an order I get this
This page isn’t working
www.MY-SITE. is currently unable to handle this request.
HTTP ERROR 500

19 Jul 2020, 11:11 AM
#1571
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

johnniejetski2:

That definitely made it better, however when I went to DELETE an order I get this
This page isn’t working
www.MY-SITE. is currently unable to handle this request.
HTTP ERROR 500
... and in your site's /logs sub-directory will be a myDEBUG-adm-{something}.log file containing details as to what that underlying issue is. Remember that since it's an admin log-file, it will contain a reference to your admin directory's name, so you need to xxx-that out prior to posting back.

27 Aug 2020, 8:54 PM
#1572
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Lat9 - Can you tell me where the zen_get_countries_name() function is defined at?

I thought i had the module working, but now I am getting an error: PHP Fatal error: Uncaught Error: Call to undefined function zen_get_countries_name() in /home/userdir/public_html/store/admin/includes/functions/extra_functions/edit_orders_functions.php:586

I looked online but I am not seeing the function in any of the ZenCart documentation.

27 Aug 2020, 11:45 PM
#1573
carlwhat avatar

carlwhat

zennedOut

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

Re: Edit Orders v4.0 Support Thread

Jeff_Mash:

Lat9 - Can you tell me where the zen_get_countries_name() function is defined at?

I thought i had the module working, but now I am getting an error: PHP Fatal error: Uncaught Error: Call to undefined function zen_get_countries_name() in /home/userdir/public_html/store/admin/includes/functions/extra_functions/edit_orders_functions.php:586

I looked online but I am not seeing the function in any of the ZenCart documentation.

looks like a typo. use:

'name' => zen_get_country_name($country_info->fields['countries_id']),
28 Aug 2020, 1:17 AM
#1574
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,768
Plugin Contributions:
9

Re: Edit Orders v4.0 Support Thread

Yep, that's it.:clap:

28 Aug 2020, 1:37 AM
#1575
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

carlwhat:

looks like a typo. use:

'name' => zen_get_country_name($country_info->fields['countries_id']),


That was it!  Good catch, and thanks for the help!
28 Aug 2020, 11:22 AM
#1576
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

Thanks, @dbltoe and @carlwhat, for the support! Changes are staged for the v4.5.2 release of EO.

28 Aug 2020, 2:39 PM
#1577
carlwhat avatar

carlwhat

zennedOut

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

Re: Edit Orders v4.0 Support Thread

Jeff_Mash:

That was it! Good catch, and thanks for the help!

lat9:

Thanks, @dbltoe and @carlwhat, for the support! Changes are staged for the v4.5.2 release of EO.

:thumbsup:

28 Aug 2020, 7:09 PM
#1578
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

I've just submitted v4.5.2 of EO to the Zen Cart moderators for review and will post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#151: Use CSS buttons during Edit Orders processing for zc156 and later.
#157: Correct MySQL error when empty shipping-tax value is entered.
#160: Correct integration for product-addition of SBA-managed product.
#163: Use zen_output_string_protected instead of to-be-deprecated zen_db_output.
#165: Correct function name (zen_get_country_name) to prevent PHP fatal error.

Thanks to @proseLA and @mc12345678 for their contributions!

31 Aug 2020, 3:49 PM
#1579
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

lat9:

I've just submitted v4.5.2 of EO to the Zen Cart moderators for review and will post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#151: Use CSS buttons during Edit Orders processing for zc156 and later.
#157: Correct MySQL error when empty shipping-tax value is entered.
#160: Correct integration for product-addition of SBA-managed product.
#163: Use zen_output_string_protected instead of to-be-deprecated zen_db_output.
#165: Correct function name (zen_get_country_name) to prevent PHP fatal error.

Thanks to @proseLA and @mc12345678 for their contributions!
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=1513

8 Sep 2020, 8:45 PM
#1580
noppie avatar

noppie

Zen Follower

Join Date:
Mar 2004
Posts:
210
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

i get this error when i try to add the admin menu
In the attachment you will see what i added and the error i got

thank you
noppie