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.
<?phpCreated on Saturday, 17 July 2010
require_once 'app/Mage.php';
Mage::app();
$order = Mage::getModel('sales/order')->load(1382);
$order->setState(Mage_Sales_Model_Order::STATE_COMPLETE);
$order->setStatus(Mage_Sales_Model_Order::STATE_COMPLETE);
$order->save();
foreach ($order->getAllItems() as $item) {
$item->setQtyCanceled(0);
$item->save();
}
Modified on Thursday, 13 January 2011
More tutorials in this section
- Uncancelling a Magento order
- Video: Inherit images of subcategory
- Connecting to Magento with SOAP (part 4)
- Connecting to Magento with SOAP (part 3)
- Connecting to Magento with SOAP (part 2)
- Events with Magento checkout
- Connecting to Magento with SOAP (part 1)
- Setting up XFabric on Fedora Linux
