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

Edit Orders v4.0 Support Thread

Views: 346,076

Results 1,541 to 1,560 of 1,927
2 May 2020, 11:16 AM
#1541
lat9 avatar

lat9

Administrator

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

Edit Orders v4.0 Support Thread

jeanjean88:

Zencart v1.5.1

EO 4.1.4

I don't have related plugins in the admin

Display Prices with Tax: true
Display Prices with Tax in Admin: true

The only thing I did notice is that if I comment the following line in functions/edit_orders_functions.php the error doesn't happen anymore, unless I add a product (so if I simply update address or prices it doesn't happen)

function eo_get_order_by_id($oID) {
global $db, $order;

// Retrieve the order
$order = new order($oID);

// Add some required customer information for tax calculation
// The next method has been modified to add required info to the
// session and global variables.

// zen_get_tax_locations();   <============================= THIS COMMENTED
That's a very old and unsupported version of both ***Edit Orders*** and ***Zen Cart***.
2 May 2020, 7:52 PM
#1542
jeanjean88 avatar

jeanjean88

New Zenner

Join Date:
Oct 2008
Posts:
27
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

If it was easier to upgrade I would have =)

Thanks for your (NON) help.

2 May 2020, 8:34 PM
#1543
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

Staying up to date is part of your responsibility as a storeowner. If you can't do it yourself, place an ad in the Commercial Help Wanted forum and hire it done.

Please remember that the people answering questions on the forum are volunteers. Be nice.

3 May 2020, 11:21 AM
#1544
jeanjean88 avatar

jeanjean88

New Zenner

Join Date:
Oct 2008
Posts:
27
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Honestly being nice was to give an HINT on how to solve the problem...

I don't need a ready-to-go solution. Just an opinion.

Unfortunately for my store upgrading is not an option, otherwise I would not be here asking for that.

18 May 2020, 4:10 PM
#1545
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Edit Orders v4.0 Support Thread

Forgive me if this has been addressed before but the instructions state "We do not recommend clicking "edit" on completed orders." So exactly what is meant by completed? Final status change / actual payment taken? The cart is using the old CEON cc mod on purpose so that the owner can edit the order and add charges for shipping and discounts. So in his mind the order isn't completed until he does exactly that and then he changes the order status to shipped. What is the reality?

18 May 2020, 6:03 PM
#1546
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

delia:

Forgive me if this has been addressed before but the instructions state "We do not recommend clicking "edit" on completed orders." So exactly what is meant by completed? Final status change / actual payment taken? The cart is using the old CEON cc mod on purpose so that the owner can edit the order and add charges for shipping and discounts. So in his mind the order isn't completed until he does exactly that and then he changes the order status to shipped. What is the reality?
That wording is carry-over from the v4.1.4 version of EO that I started with. I suppose that DivaVocals was just being cautious in her wording.

Things that can go wrong:

  • A product in an old order is no longer stocked by the store.
  • A product-option in an old order is no longer available for a product in the order.
18 May 2020, 6:14 PM
#1547
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Edit Orders v4.0 Support Thread

so in other words, the longer you wait to edit an order, the more problematic it could possibly be. Perhaps changing the wording in the instructions? Is this in github?

19 May 2020, 1:26 PM
#1548
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

delia:

so in other words, the longer you wait to edit an order, the more problematic it could possibly be. Perhaps changing the wording in the instructions? Is this in github?
You bet: https://github.com/lat9/edit_orders

21 Jun 2020, 5:00 PM
#1549
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

EO 4.5.0, Zen Cart 1.5.6. It appears that orders with a tax line item have the tax order total entry removed after an order update.
Is this an integration problem on my end or have others seen it?

21 Jun 2020, 5:19 PM
#1550
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:

EO 4.5.0, Zen Cart 1.5.6. It appears that orders with a tax line item have the tax order total entry removed after an order update.
Is this an integration problem on my end or have others seen it?
zc156, no suffix? What are you using for the product-pricing method?

I'm not seeing this on zc156c/eo450.

21 Jun 2020, 6:30 PM
#1551
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

Sorry, 156c. Product Pricing - tested manual and auto, both had the same issue. OK I will dig in on my side.

21 Jun 2020, 9:11 PM
#1552
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

Investigating ...

admin/includes/functions/extra_functions/edit_orders_functions.php lines 1429-1445 you are referencing $order->totals[$i]['class'].
This should be $order->totals[$i]['code'] shouldn't it?

(lines are same between EO 4.5.0 and 4.5.1)

21 Jun 2020, 11:11 PM
#1553
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

The root cause of the deleted tax line is in the block that handles the "rogue" ot_tax value.
(Around 1449 of ./includes/functions/extra_functions/edit_orders_functions.php).

My tax title is Sales tax (if any) + Shipping Tax (0.0000%) + Tax:

which does not work for the clause

title NOT IN ($tax_groups)

Perhaps a LIKE would be better - something like

foreach ($tax_groups as &$tax_group) {
   $tax_group = '%' . $db->prepareInput($tax_group) .'%'. ':';
}
$tax_groups = "'" . implode("', '", $tax_groups) . "'";
...
$query = 
                "DELETE FROM " . TABLE_ORDERS_TOTAL . "
                  WHERE orders_id = $oID
                    AND `class` = 'ot_tax'
                    AND `title` NOT IN (";  
for ($i = 0; $i < count($tax_groups); $i++) {
   if ($i > 0) $query .= ","; 
   $query .= $tax_groups[$i]; 
}
$query .= ")";
21 Jun 2020, 11:15 PM
#1554
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

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)

22 Jun 2020, 11:10 AM
#1555
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:

Investigating ...

admin/includes/functions/extra_functions/edit_orders_functions.php lines 1429-1445 you are referencing $order->totals[$i]['class'].
This should be $order->totals[$i]['code'] shouldn't it?

(lines are same between EO 4.5.0 and 4.5.1)
Nope, the $order->totals array is 'indexed' by its *class *element.

The $order_total_modules, just to make life interesting, returns each module's entry with a reference to its *code *(aka the order's class) element.

22 Jun 2020, 11:19 AM
#1556
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 created by the class, yes - but by the time it gets to eo_update_database_order_totals, the array entries have been changed. See screenshot.

22 Jun 2020, 11:19 AM
#1557
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:

The root cause of the deleted tax line is in the block that handles the "rogue" ot_tax value.
(Around 1449 of ./includes/functions/extra_functions/edit_orders_functions.php).

My tax title is Sales tax (if any) + Shipping Tax (0.0000%) + Tax:

which does not work for the clause

title NOT IN ($tax_groups)

Perhaps a LIKE would be better - something like

foreach ($tax_groups as &$tax_group) {
$tax_group = '%' . $db->prepareInput($tax_group) .'%'. ':';
}
$tax_groups = "'" . implode("', '", $tax_groups) . "'";
...
$query =
"DELETE FROM " . TABLE_ORDERS_TOTAL . "
WHERE orders_id = $oID
AND class = 'ot_tax'
AND title NOT IN (";
for ($i = 0; $i < count($tax_groups); $i++) {
if ($i > 0) $query .= ",";
$query .= $tax_groups[$i];
}
$query .= ")";

Hmm, looks like you've got ***My Store::Show Split Tax Lines*** set to *false*.  Let me investigate further.
22 Jun 2020, 11:22 AM
#1558
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:

As created by the class, yes - but by the time it gets to eo_update_database_order_totals, the array entries have been changed. See screenshot.
You're displaying the contents of the $order_totals array, as returned by $order_total_modules->process, not the contents of $order->totals.

22 Jun 2020, 11:23 AM
#1559
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

Aside: sorry, that suggested code didn't come out quite right - I was thinking a LIKE with all strings concatenated with % between strings (and before and after).

22 Jun 2020, 11:25 AM
#1560
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:

You're displaying the contents of the $order_totals array, as returned by $order_total_modules->process, not the contents of $order->totals.

CRAP! You are correct, sorry for the false report.