Can’t change the Order status to Canceled in Magento Admin

Some time we cannot cancel the order in Magneto backend. The following statements need to be true before an order can be cancelled from adminpanel.

  1. If the payment can be voided,
  2. If you cannot unhold the order,
  3. If all items have have not been invoiced,
  4. If the order is not cancelled, complete or closed,
  5. Or if the order has not already been flagged to be cancelled,

But this can be achieved by running sql query directly on the PHPMyadmin.

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

UPDATE `sales_flat_order` SET `status` = 'canceled', `state` = 'canceled' 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 ‘Canceled’. 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. Required fields are marked *