Update Magento Order Status by direct SQL

Sometimes we need to change the Order status on the Sales order grid on the Magento to ‘Complete’ but we are unable to do that. But this can be achieved by running sql query directly on the PHPMyadmin.

UPDATE `sales_flat_order_grid` SET `status` = 'complete' WHERE `sales_flat_order_grid`.`entity_id` = ENTITY_ID;

UPDATE `sales_flat_order` SET `status` = 'complete', `state` = 'complete' WHERE `sales_flat_order`.`entity_id` = ENTITY_ID;

In the above sql queries ENTITY_ID will be replaced by an Order ID which status to be changed to ‘Complete’. We can get the Order ID from the admin panel. To get this value navigate to ‘Sales -> Orders’ in the admin and click the Order row you want to change status. Once you are in the Order details page please check the URL and see the number placed between ‘order_id’ and ‘key’ and this is the Order ID

For example the following image ‘799’ is the ‘ENTITY_ID’ will be used in the SQL query.

Magento Order ID

 

Cheers!

Leave a Reply

Your email address will not be published.

5 × four =