I am using the event <sales_order_place_after>
in my observer to perform some action. I am inserting the Order ID in my custom table. But what I observe is that it does not give me Order ID but instead Increment ID
, which I am fetching using getReservedOrderId()
.
Now to fetch Order ID from Increment ID I can use,
$order = Mage::getModel('sales/order')->load($incrementId, 'increment_id');
but I need to insert the data at the time of order placed, instead of fetching it again.
Observer Code;
$order = $observer->getEvent()->getOrder(); //returns null
So I am using
$order = $observer->getEvent()->getOrder()->getQuote();
Which event should be used in order to get all order details after an order is placed or on order success ?