Every single controller has a default generic event that can be used for observers. They follow the following naming convention:
- Before dispatching the action:
<controller_action_predispatch_<module>_<controller>_<action>>
- After dispatching the action:
<controller_action_postdispatch_<module>_<controller>_<action>>
In your case, it would be the following event: <controller_action_postdispatch_checkout_onepage_saveOrder>
Then in order to observer this specific event, you need to add the following code to your global
tag of your config.xml
file:
<controller_action_postdispatch_checkout_onepage_saveOrder>
<observers>
<unique_name_for_observer>
<type>singleton</type>
<class>module/observer</class>
<method>postDispatchSaveOrder</method>
</unique_name_for_observer>
</observers>
</controller_action_postdispatch_checkout_onepage_saveOrder>
This is assuming that your models are declared under module
class name.
Then you need to create the Model/Observer.php
file which would look like this:
<?php
class My_Module_Model_Observer
{
public function postDispatchSaveOrder(Varien_Event_Observer $observer)
{
// Get the response
$post = $observer->getControllerAction()->getResponse();
// Do what you need to do with the response
}
}