1

I have a simple custom module that sends a separate email to an admin user once an order has been placed (email uses a different template). This email is supposed to work for orders placed from the frontend or the backend.

The event gets triggered when a frontend order is placed, but not when a backend order one is placed, although the event is global.

Here is my config.xml

<global>
    <events>
        <sales_order_place_after>
            <observers>
                <adminneworderemail_order_place>
                    <type>singleton</type>
                    <class>adminneworderemail/observer</class>
                    <method>orderPlace</method>
                </adminneworderemail_order_place>
            </observers>
        </sales_order_place_after>
    </events>
</global>

And the Observer function being triggered:

public function orderPlace($observer){
    $order = $observer->getData('order');
    $orderId = $order->getId();
    $this->sendAdminOrderNotification($orderId);
}

Does anyone have any idea what I am doing wrong? I am using magento 1.9.3.1

  • Please try sales_order_save_after instead of sales_order_place_after – Kul Jan 20 '17 at 14:25
0

You need to change your event in config.xml. Use:

adminhtml_sales_order_create_process_data

OR

sales_order_save_after

Updated config.xml

<global>
<events>
    <sales_order_save_after>
        <observers>
            <adminneworderemail_order_place>
                <type>singleton</type>
                <class>adminneworderemail/observer</class>
                <method>orderPlace</method>
            </adminneworderemail_order_place>
        </observers>
    </sales_order_save_after>
</events>

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.