Jump to content

[SOLVED] How to update Order Status via database


Recommended Posts

Hi Guys,

 

Okay here is a helpful code that you can use to update any number of orders at a time. I just updated about 1000 orders in 5 minutes. As always, please do a test for 1 item first and see if it works, then do any number.

 

1) Open PHP Myadmin

2) Open table order_status_lang

3) Note the appropriate order_state numbers

4) Open table order_history and enter the following code

5) This code will update the status for orders 1,2,3,4,5 to Shipped

UPDATE `order_history`
SET `id_order_state` = 4
WHERE `id_order` = 1
OR `id_order` = 2
OR `id_order` = 3
OR `id_order` = 4
OR `id_order` = 5;

I hope this helps some you. Note the numbers do not have to be sequential and you can create the repetitive statements for "OR 'id_order' = 2" in excel.

Cheers

Share this post


Link to post
Share on other sites
  • 2 weeks later...

UPDATE `shop`.`ps_order_history` SET `id_order_state` = '5' WHERE `id_order_state` =4;

 

That one change it from Orderstate 4 to Orderstate 5.

 

And it don't care about order number or anything.

Share this post


Link to post
Share on other sites

I agree, your sql statement will do it for all your orders from the day your opened your shop.

 

It will also change "payment errors, refunds, cancels etc to the new status. I dont recommend this way, as it will certainly cause issues later.

Share this post


Link to post
Share on other sites
  • 4 weeks later...

I've been meaning to make an update to this post for awhile.

We will be working on the table Order_history.

 

The table has the following columns

- id_order_history - Auto increment field, so please check what the next number should be.

- id_employee - Your employee id number

- id_order - The actual order id

- id_order_state - The status you want to change it to.

- date_add - Filled in the correct format or it will not work yyyy-mm-dd hh:mm:ss

 

1) Create a csv file with all the above fields filled for all the orders you want to update.

2) Once filled, save the csv file, close it and open it again to make sure the date format is correct

3) If it is, next in phpMyAdmin, open table order_history and goto the import tab.

4) Browse to your saved csv file and import it

 

Check your stores backoffice settings orders/statuses email settings. Make sure whichever status you are changing to, will send the email.

 

Enjoy !

Share this post


Link to post
Share on other sites
  • 4 years later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More