2

How to Set Order Status to “Processing to Pending” after payment success in magento 1.9.3?

1 Answer 1

0

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 
12
  • in which folder put this code? Commented Feb 3, 2017 at 7:04
  • 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.
    – BornCoder
    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.
    – BornCoder
    Commented Feb 3, 2017 at 7:18
  • okay but which line paste this code? Commented Feb 3, 2017 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.