Magento News
Retriving the orderid of a current checkout session within a observer in magento
i am trying to retrieve the orderid of a order that is just been created during checkout process (after the place order button is clicked). I have a observer is listening to the sales_order_place_after event. I am trying to retrieve the order id using this code :
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId(); which returns the order id of the previous order and not the current order that was just created during the checkout. If i use something like this :
$order = Mage::getModel('sales/order');
$order->load(Mage::getSingleton('sales/order')->getLastOrderId());
$lastOrderId = $order->getIncrementId();
I donot get the order id. The reason i am trying to do this is to set all the order status to hold or pending when they are created initially and when the user makes a successful transaction, i will be changing the status to processing. How do i retrieve the current order id for the checkout session in progress within a observer? Thanks.
Retriving the orderid of a current checkout session within a observer in magento
Possibly Related Posts:
- Database query different results
- Menu highlight in magento under admin
- magento disable a banner on certain category pages or have a banner with multiple links
- Magento, using ACL for frontend. Possible?
- Magento IE-7 Fix In Windows XP
RSS Feed