phantomeye 11 Posted November 2, 2011 Posted November 2, 2011 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
cassim 8 Posted November 15, 2011 Posted November 15, 2011 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
phantomeye 11 Posted November 15, 2011 Posted November 15, 2011 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
PrestaMagic 7 Posted December 11, 2011 Posted December 11, 2011 Will that still send an email to the customer? Share this post Link to post Share on other sites
PrestaMagic 7 Posted December 11, 2011 Posted December 11, 2011 Well, from my quick test, it doesn't appear to. I need a way to programmatically update that order status and send an email for statuses that require it. Any ideas on this? Share this post Link to post Share on other sites
phantomeye 11 Posted December 11, 2011 Posted December 11, 2011 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
sumit mohanty 0 Posted March 17, 2016 Posted March 17, 2016 How to insert data programmatically in database ? Please help asap. Share this post Link to post Share on other sites
Recommended Posts