0

I am new to Magento, but what I need to do is:

after the order is saved, I have to call an external webservice and pass some order data to this service.

Where or what is the best place to do so?

thanks in advance

1
  • Which magento version? Every time order saved (create/update) or after place order?
    – Sohel Rana
    Sep 3, 2017 at 16:34

1 Answer 1

0

Create custom module and call your method in sales_order_place_after event For example Your module xml

<events>
    <sales_order_place_after>
        <observers>
            <your_module_event_handler_name>
                <class>your_module/observer</class>
                <method>extraAction</method>
            </your_module_event_handler_name>
        </observers>
    </sales_order_place_after> 
</events> 

Your function

public function extraAction(Varien_Event_Observer $observer) {
    $order = $observer->getEvent()->getOrder();
    // your code here
}

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.