I have created a module for listening to the event sales_order_place_after. I did it following the article http://www.atwix.com/magento/auto-invoice-and-custom-order-status-upon-checkout.

I use it for set my order to processing status, because it's always changed to pending that I set with new order status.

The module works in Magento 1.8.0, but it doesn't work in magento 1.9.1. How could I resolve this problem? Please help me

This is how the module is built:

  1. First, I create a module initializer in /app/etc/modules/Atwix_Orderhook.xml with following content

    <?xml version="1.0"?>
  2. then I create a module configuration file /app/code/community/Atwix/Orderhook/etc/config.xml with content

    <?xml version="1.0"?>
  3. finally I create the app/code/community/Atwix/Orderhook/Observer.php with following content

    class Atwix_Orderhook_Model_Observer 
        public function implementOrderStatus($event)
            $order = $event->getOrder();
            if ($this->_getPaymentMethod($order) == 'cwinline') {
            return $this;
        private function _getPaymentMethod($order){        {
            return $order->getPayment()->getMethodInstance()->getCode();
        private function _processOrderStatus($order){
            $status = $order->getPayment()->getStatus();
            return true;
        private function _changeOrderStatus($order){
        $statusMessage = 'payment success';
        $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING,Mage_Sales_Model_Order::STATE_PROCESSING,$statusMessage, false);        
  • it's hard to pinpoint the issue without looking at the code, are you using the code exactly as it shows on the article? Do you get any error in the logs? The event name is the same in 1.9.1 so the must be something wrong elsewhere. Sep 11, 2015 at 9:25
  • I will update my question right now,hold on please.
    – kyo
    Sep 11, 2015 at 9:30
  • 4
    Path of the observer is wrong, it should be app/code/community/Atwix/Orderhook/Model/Observer.php, You are missing Model Sep 11, 2015 at 9:59
  • 1
    @NasirPerwaiz, please write your comment as an answer as it provides the solution to the OP's question. Thanks!
    – 7ochem
    Sep 11, 2015 at 13:59
  • 1
    @NasirPerwaiz, agree with 7ochem, you should write it as answer, then OP can mark it as correct answer if that has helped him. Cheers. Sep 11, 2015 at 14:24

2 Answers 2


As suggested by 7ochem and Adarsh Khatri I am writing my answer, The path to your observer Model is wrong. It should be,


The node in your config.xml file should be placed in a new

<frontend> node under </global>

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.