Ozair Kafray
Ozair Kafray

Reputation: 13539

Magento - Adminhtml - Get id of order just created

I want to do some post processing on an order, made using admin panel.

I have subscribed to the controller_action_postdispatch_adminhtml_sales_order_create_save event, and the correct function of this observer is being invoked.

How can I get the id of the order just saved in the saveAction in my function.

Upvotes: 2

Views: 660

Answers (1)

Joe Mastey
Joe Mastey

Reputation: 27119

Mage_Adminhtml_Model_Sales_Order doesn't appear to save the order in the session anywhere, so this may be tough with the event you've chosen. In fact, the controller action you specified calls _getSession()->clear() to lose all the data from the session.

I would suggest finding a different event to use.

Upvotes: 3

Related Questions