2

I want to change all the orders that are in the status of "Processing" to "Complete" state.

I managed to find this in the sales_order table and set the state and status to complete. This worked fine and when I access the order, the state and status are now "Complete":

enter image description here

However, in the admin grid, it is still showing "Processing". How can I change this directly in the database?:

enter image description here

9

Rakesh Donga pointed out the two Queries but more specific queries based on your situation

UPDATE sales_order SET state='complete', status='complete' WHERE status = 'processing'
UPDATE sales_order_grid SET status='complete' WHERE status = 'processing'

After you update the sales_order and sales_order_grid table, you also have to add record in sales_order_status_history table as well by inserting the row against each order. Example row insert query

INSERT INTO `sales_order_status_history` (`parent_id`, `is_customer_notified`, `is_visible_on_front`, `comment`, `status`, `created_at`, `entity_name`) VALUES (1, 0, 0, NULL, 'complete', NOW(), 'order');

In this query parent_id is order entity_id.

I hope this will help

2

The first query will update the state and status on the table sales_order.

mysql> UPDATE sales_order SET state='complete', status='complete' WHERE increment_id IN (000043719,000044003,000044117,...);
Query OK, 15 rows affected (0.08 sec)
Rows matched: 16  Changed: 15  Warnings: 0

The second one will update the status in the grid view in Sales > Orders.

mysql> UPDATE sales_order_grid SET status='complete' WHERE increment_id IN (000043719,000044003,000044117,...);
Query OK, 15 rows affected (0.03 sec)
Rows matched: 16  Changed: 15  Warnings: 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.