How Yireo adds value:

Uncancelling a Magento order

A Magento order could be cancelled by mistake, but there is no way to undo this action - at least not in the GUI. There might be excellent third party modules providing this functionality, but you could also write just a simple PHP-script to accomplish the same task.

The clue to uncancel an order, is that - while you can change the order itself by changing its state and status, you also need to uncancel the order-items within that order. The following PHP-script could be run from the command-line to uncancel a specific order.

require_once 'app/Mage.php';

$order = Mage::getModel('sales/order')->load(1382);

foreach ($order->getAllItems() as $item) {
Written on 17 July 2010 by Jisse Reitsma

About the author

Jisse Reitsma is the founder of Yireo, extension developer, developer trainer and two times Magento Master. His passion is for technology and open source. And he loves talking as well.

Looking for a training in-house?
Let's get to it!