Thursday, December 4, 2014

How to Un-Cancel Magento order

I know that there is possibility that we could find some articles on the internet with this thematic, but let me add my own version.
Let’s first say that programmatic Un-Canceling orders should not be the best way to resolve issues with order cancelled by mistake.

I would recommend to re-create order from admin instead (if possible). But there are some specific situations in which we really need to do this, so let’s get to the code:
  $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
                  'pending_payment', 'This order is uncanceled by Admin!');
  //Don't forget to un-cancel order items ...
  foreach ($order->getAllItems() as $item) {
That’s it for now. I hope that this small tip will be useful


1 comment:

  1. More complex than I thought! Thanks for posting this.