How to Set Order Status to “Processing to Pending” after payment success in magento 1.9.3?
1 Answer
Have a go with the sales_order_place_after
event, this is fired after the call to $this->_placePayment();
in Mage_Sales_Model_Order::place()
so it should be after any other status changes have happened.
$_order = new Mage_Sales_Model_Order();
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$_order->loadByIncrementId($orderId);
// Update order
$order = Mage::getModel('sales/order')->loadByIncrementID($orderId);
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
$order->save();
// Write your success Massage here
-
-
i hope you know how to use event and observer. You can put this code in your observer file and this will update status of your order after place order. Commented Feb 3, 2017 at 7:10
-
app\code\core\Mage\Sales\Model\Observer.php ?in which line? Commented Feb 3, 2017 at 7:13
-
don't edit core. create a custom module and write event and observer in custom module. Editing core is not good practise. Commented Feb 3, 2017 at 7:18
-