1

Does Magento have any observer or event that trigger when the Order Address is updated by the admin? Is there any Observer or alternate way to find out when the order address is changed..

i tried using the observer
controller_action_predispatch_adminhtml_sales_order_addressSave but i cannot get any order related information and sales_order_address_save_after is being triggered when the order is placed too ..

0

I think best approach would be using sales_order_address_save_after event, if you are not creating orders through admin

You can easily validate if a request is from admin or not using this 2 validations:

Mage::app()->getStore()->isAdmin()
Mage::getDesign()->getArea() == 'adminhtml'

Then just do nothing in your observer if request is frontend

Other than that, you can define your observers in config.xml files for a specific areas, such as adminhtml

<config>
...
    <adminhtml>
        <events>
            <sales_order_address_save_after>
                <observers>
                ...
                </observers>
            </sales_order_address_save_after>
        </events>
    </adminhtml>
</config>

Likewise, I'd use the request code validation, just to be sure

Hope this helps

  • That is a great idea.. Thank you so much.. should definitely go with sales_order_address_save_after with those 2 validations but is there any solution for "creating orders through admin" ..so i think can we use sales_order_address_save_before and check whether the Order is already created or not?? is it possible to check this way?? thanks for the help :) – Chaitanya May 9 '17 at 7:03
  • I suppose you can identify that case with some more specific events, take a look at Mage_Adminhtml_Sales_Order_CreateController file & play with it. Feel free to accept the answer as valid if this helped ;) – Raul Sanchez May 9 '17 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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