Public Member Functions | |
salesOrderBeforeSave ($observer) |
Definition at line 34 of file Observer.php.
salesOrderBeforeSave | ( | $ | observer | ) |
Set forced canCreditmemo flag
Varien_Event_Observer | $observer |
Definition at line 42 of file Observer.php.
00043 { 00044 $order = $observer->getEvent()->getOrder(); 00045 00046 if ($order->getPayment()->getMethodInstance()->getCode() != 'free') { 00047 return $this; 00048 } 00049 00050 if ($order->canUnhold()) { 00051 return $this; 00052 } 00053 00054 if ($order->getState() === Mage_Sales_Model_Order::STATE_CANCELED || 00055 $order->getState() === Mage_Sales_Model_Order::STATE_CLOSED ) { 00056 return $this; 00057 } 00058 00059 $order->setForcedCanCreditmemo(true); 00060 return $this; 00061 }