/** * Start edit order initialization */ public function startAction() { $this->_getSession()->clear(); $orderId = $this->getRequest()->getParam('order_id'); $order = Mage::getModel('sales/order')->load($orderId); try { if ($order->getId()) { if (!$order->getIsExported()) { return parent::startAction(); } else { $response = Mage::helper('realtimedespatch/service')->getOrderService()->cancelOrder(new Order($order->getIncrementId())); Mage::getSingleton('adminhtml/session')->addSuccess("Cancellation success: " . $response); return parent::startAction(); } } } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError('Error cancelling order at OrderFlow: ' . $e->getMessage()); return parent::startAction(); } }
protected function _processActionData($action = null) { $this->getRequest()->setPost('reset_shipping', 0); parent::_processActionData($action); }