Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

List of events on orders in Magento
 
The_4th_knight
Sr. Member
 
Total Posts:  88
Joined:  2012-04-23
 

Hello,im trying to extract these data: customer.entity_id,firstname,lastname,email ,id customer order,id order,product_id,type of product,and name of product.
What kind of events i need to intercept?
How i can do this?
Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MattStephens
Sr. Member
 
Avatar
Total Posts:  152
Joined:  2011-07-12
United Kingdom
 

Hello

The one I’d recommend using is:
- sales_model_service_quote_submit_after

Here you can access the order details as well as shipping etc.

This is how it’s called:

Mage::dispatchEvent('sales_model_service_quote_submit_after', array('order'=>$order'quote'=>$quote));

In line 210 of app/code/core/Mage/Sales/Model/Service/Quote.php

You can also look at:

- checkout_type_onepage_save_order_after
- sales_order_place_after

A list of events can be found here...

Hope this helps

Cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
The_4th_knight
Sr. Member
 
Total Posts:  88
Joined:  2012-04-23
 
MattStephens - 04 December 2012 01:19 AM

Hello

The one I’d recommend using is:
- sales_model_service_quote_submit_after

Here you can access the order details as well as shipping etc.

This is how it’s called:

Mage::dispatchEvent('sales_model_service_quote_submit_after', array('order'=>$order'quote'=>$quote));

In line 210 of app/code/core/Mage/Sales/Model/Service/Quote.php

You can also look at:

- checkout_type_onepage_save_order_after
- sales_order_place_after

A list of events can be found here...

Hope this helps

Cheers

Can you explain an example of code?.....

 
Magento Community Magento Community
Magento Community
Magento Community
 
MattStephens
Sr. Member
 
Avatar
Total Posts:  152
Joined:  2011-07-12
United Kingdom
 

Hello

You need to add a method to be triggered on the event that I mentioned above. To do that you could do something similar to this, but change the event defined in the XML to be “sales_model_service_quote_submit_after” instead of “controller_action_layout_load_before”.

And in the method you define in your observer class use:

$observer->getEvent()->getOrder()
$observer->getEvent()->getQuote()

To get what you need.

Hope this helps

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top