We use Onepage checkout in Magento 1.4

The file where the work is done is:


The function is saveOrderAction()

I want to perform an action after the order has been saved, but a) I don't see any dispatchEvent call in this function and b) I don't know which event to use or to search for.

I have seen exhaustive event lists for Mage 1.x, but I don't know how to correlate to this method.

I also need to know how to add the <observer> XML and place the function, as I have never done this before.

2 Answers 2


Hi you can use sales_order_place_after event.you need to define below code in your module config.xml.


If you need to define file under following path: app/code/YOUR_CODEPOOL/NAMESPACE/YOUR_MODULE/Model/NAME_OF_FILE_IN_MODEL_FOLDER.php Like Observer.php

In above file need to create function in observer.php with name which define in tag of config.xml:

    public function sales_order_afterPlace($observer)
      $order = $observer->getEvent()->getOrder();
      /*YOUR LOGIC*/

I hope this will help you.

  • perfect answer with explanation! +1 :) Oct 2, 2017 at 10:35

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:


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:


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.