If this is your first visit, check our documentation. To post, register or login.
Forums / Customization from the Admin / Change all orders from status 'x', to status 'y'.

Change all orders from status 'x', to status 'y'.

Started by bi11i on 21 Jul 2011, 5:48 PM · Views: 1,465

Results 1 to 4 of 4
21 Jul 2011, 5:48 PM
#1
bi11i avatar

bi11i

Zen Follower

Join Date:
Jun 2005
Location:
Portland, OR
Posts:
157
Plugin Contributions:
0

Change all orders from status 'x', to status 'y'.

I can't remember why I did this, but I created an additional order status "Shipped" (ID5). Is there a sql query I could run to change all of these to Shipped (ID3)?

Thanks in advance....

22 Jul 2011, 2:23 AM
#2
gaurav10feb avatar

gaurav10feb

Zen Follower

Join Date:
Jan 2010
Location:
Australia
Posts:
243
Plugin Contributions:
1

Re: Change all orders from status 'x', to status 'y'.

you can simply run UPDATE orders SET orders_status = '3'

  • Please bear in mind few steps
  1. this will change every order in your shop to shipped.
  2. this will not show on order history as that is a seperate table.

Believe it or not But My existence is illusional

22 Jul 2011, 2:55 AM
#3
bi11i avatar

bi11i

Zen Follower

Join Date:
Jun 2005
Location:
Portland, OR
Posts:
157
Plugin Contributions:
0

Re: Change all orders from status 'x', to status 'y'.

thanks for the help, but that's not quite what i want to do.

there's no easy way to simply change ID5 to ID3 with a sql query?

gaurav10feb:

you can simply run UPDATE orders SET orders_status = '3'

  • Please bear in mind few steps
  1. this will change every order in your shop to shipped.
  2. this will not show on order history as that is a seperate table.
22 Jul 2011, 5:49 AM
#4
swguy avatar

swguy

Administrator

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

Re: Change all orders from status 'x', to status 'y'.

Make a db backup, then:

UPDATE orders SET orders_status = '3' WHERE orders_status = '5';
UPDATE orders_status_history SET orders_status = '3' WHERE orders_status = '5';

If the number of orders with status 5 is small, though, you might just do this by hand so you could make a status update note about the change you're making. To determine the number of orders in this state, do

SELECT COUNT(*) FROM orders WHERE orders_status = '5';

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.