Forums / Managing Customers and Orders / Help with changing multiple order statuses at one time

Help with changing multiple order statuses at one time

Started by helenewallis on 9 Oct 2016, 11:04 PM · Views: 2,967

Results 1 to 15 of 15
9 Oct 2016, 11:04 PM
#1
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Help with changing multiple order statuses at one time

My order fullfillment people are bugging me to give them a way to change all the orders marked 'New Order' to 'Processing' at one time, so they don't have to go in and change them individually. We're already using the utility to print all the packing slips at one time, so this would be a logical extension to that. I've found the code where they get changed one at a time, and can probably figure out how to change them all from one status to another--I know what the SQL command needs to be. But right now, adding a button on the orders.php page, even without a dropdown list to choose from, is beyond my skills and beyond my time to work out.

Has anyone else done this and could you give me some help with it? It seems like such a useful feature that I'm surprised it isn't already included.

I do realize that we don't have to change the status before we can process the order. But it gives me a quick visual check of what is shipped and gone, what is new but hasn't been shipped, and what is really new and might need me to look it over. I look for things like a difference between the billing and shipping addresses (Paypal orders sometimes have an outdated shipping address, for example). And I look for notes on an order that might need an email before shipping. So I really need to make the distinction between a brand new order and one that just hasn't been shipped yet.

Thanks in advance :)

10 Oct 2016, 7:55 AM
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,879
Plugin Contributions:
7

Re: Help with changing multiple order statuses at one time

I believe Super Orders does this...but I don't use it.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

10 Oct 2016, 1:42 PM
#3
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

I downloaded Super Orders, but after having a total mess from one of their other add-ons, I'm very reluctant to install it.

10 Oct 2016, 3:19 PM
#4
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,879
Plugin Contributions:
7

Re: Help with changing multiple order statuses at one time

For all but the simplest "plugins", I drop it into a vanilla LOCAL install of whatever version of ZC it is SUPPOSED to be compatible with.
If it falls over at this point, you know what you are dealing with....

If it does what is says on the tin, then drop it into a vanilla LOCAL version of the current ZC, same testing and fixing before letting it loose on your LOCAL development copy of your real site. I do all on php7 too, to flag up more things in advance.

So way before it gets anywhere near your real/production/non-broken/making-money so leave it alone as much as possible site you should have enough experience to trust or bin it.

Anyone who copies code from the "plugins" to their production site without testing it somewhere else first needs professional care.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

10 Oct 2016, 7:48 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Help with changing multiple order statuses at one time

Helene,
Awhile back I updated the All Invoices plugin to accommodate the ability to not only print (to screen) a list of invoices for a certain order-status (which it already did), but to also optionally update those orders to a new status afterward. I hadn't packaged it up yet, but I just did a quick (hopefully correct) merge and uploaded it:
https://www.zen-cart.com/downloads.php?do=file&id=1083

Perhaps that may be a useful tool for you ... or at least give you some code ideas to work with for accomplishing something similar to suit your needs.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Oct 2016, 12:18 PM
#6
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

Yes, thank you! I did install Super Orders on my test site, but the only thing it does that I have any interest in is the multiple status update. Even that is too clunky for my people to use. I just need a button they can click on to change all New Order statuses to Processing. They don't need to be putting in a date range and downloading a subset of the database first, someone would screw that up for sure.

I've go have a look at this. We normally print only packing slips, not invoices, but I can probably move the code over to the allpackingslip program.

11 Oct 2016, 12:21 PM
#7
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

torvista:

For all but the simplest "plugins", I drop it into a vanilla LOCAL install of whatever version of ZC it is SUPPOSED to be compatible with.

I don't install anything without checking it on my test site first. That said, I don't really want a big hassle to uninstall something from my test site either.

I did install it on my test site and found that it doesn't answer my need to change multiple orders at one time (without multiple steps that I don't trust my people to do). And it doesn't have anything else at all that I can use. So now I have to get rid of it, which is going to be a lengthy process.

11 Oct 2016, 2:32 PM
#8
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

DrByte:

Helene,
Awhile back I updated the All Invoices plugin to accommodate the ability to not only print (to screen) a list of invoices for a certain order-status (which it already did), but to also optionally update those orders to a new status afterward.

After looking at it, I realized that the way you laid it out, we can change the order status without having to print the invoices. We'll use this for the time being, and thank you very much!

Oops--editing this to say that the order status didn't get updated, even after printing the invoices.

11 Oct 2016, 2:37 PM
#9
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

It's just repeatedly resetting it to New Orders every time I run it. I'm sure it's a minor fix though. Um, looking at the code, I see what the problem is. It's setting the order status to 2, which is where I have New Orders set. I can fix that.

11 Oct 2016, 3:00 PM
#10
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

Help?? Not sure what I'm doing wrong. This looks like what I need to change, but I get an error message every time. It's line 81 in all_invoices.php. I'm clearly not expressing the order_status variable correctly, but I'm not sure what I need to do different.

$sql = "UPDATE " . TABLE_ORDERS . " SET orders_status = " . (int)$status . ", last_modified = now() where orders_id = " . (int)$oID;
11 Oct 2016, 3:35 PM
#11
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

Never mind, I figured it out :)

One minor issue still--it is changing the order status but not updating the status in the comment list. Can you help me with that?

11 Oct 2016, 4:35 PM
#12
lat9 avatar

lat9

Administrator

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

Re: Help with changing multiple order statuses at one time

Helene, I haven't had a chance to see what changes DrByte introduced but I'll follow-up and let you know.

What version of Zen Cart (and PHP) is your store running on?

11 Oct 2016, 6:54 PM
#13
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

Zencart 1.55a and php 5.6

DrByte set it to change to an order status of 2. I forced a change to '10' for the status, since that's what we're using for 'Processing.' It would be nice to be able to choose, though it's very unlikely we'll ever change. But it would be more flexible for others.

11 Oct 2016, 7:07 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Help with changing multiple order statuses at one time

HeleneWallis:

Never mind, I figured it out :)

One minor issue still--it is changing the order status but not updating the status in the comment list. Can you help me with that?

HeleneWallis:

Zencart 1.55a and php 5.6

DrByte set it to change to an order status of 2. I forced a change to '10' for the status, since that's what we're using for 'Processing.' It would be nice to be able to choose, though it's very unlikely we'll ever change. But it would be more flexible for others.

Ya, currently it uses the $status set on line 79: https://github.com/lat9/all_invoices/blob/master/YOUR_ADMIN/all_invoices.php#L79
And the messaging on line 169: https://github.com/lat9/all_invoices/blob/master/YOUR_ADMIN/all_invoices.php#L169

A future enhancement could allow a dropdown to choose a status, and merely "default to" that $status value, instead of forcing it. And it looks like @lat9 has already recorded that as an open issue/enhancement in her github repo: https://github.com/lat9/all_invoices/issues

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Oct 2016, 6:10 PM
#15
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Help with changing multiple order statuses at one time

Thanks, sorry not to reply more quickly, it's been a three-ring circus here the last few days. We're happy with how it's working now, and will look forward to seeing this as an enhancement in the new version.