Uncancel order magento

This tutorial explains how to uncancel order magento 1.9.

Please click here to refer other tutorials.

Uncancel order magento

load(86066);
echo $order->getStatus().PHP_EOL;
echo $order->getState().PHP_EOL;
//$order->setState(Mage_Sales_Model_Order::STATE_COMPLETE);
$order->setStatus(Mage_Sales_Model_Order::STATE_COMPLETE);
echo $order->getData('state').PHP_EOL;
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE);
$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
$order->save();

foreach ($order->getAllItems() as $item) {
    $item->setQtyCanceled(0);
    $item->save();
}
echo $order->getStatus();
echo $order->getState().PHP_EOL;

Share this Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *