I went to Admin Panel > Sales > Payment Methods > Bank Transfer Payment > New Order Status. I updated it to "pending" however when I place a new order the status still went to "processing".

I tried this. I went to code/core/Mage/Sales/Model/Order/Payment.php:

protected function _authorize($isOnline, $amount)
    // update totals
    $amount = $this->_formatAmount($amount, true);

    // do authorization
    $order  = $this->getOrder();
    $state  = Mage_Sales_Model_Order::STATE_PROCESSING;
    $status = true;

I changed the STATE_PROCESSING to STATE_NEW to set it on "pending" but when I place a new order the status still went to "processing".

My Reference

How can I change the new order status to pending for bank transfer?

My Magento version is

Here's the screenshot:

enter image description here

1 Answer 1


Using a custom Magento module can do this task. Let’s name it Atwix_Orderhook.

Step 1 : First,Create a module initializer in /app/etc/modules/Atwix_Orderhook.xml with the following content:

<?xml version="1.0"?>

Step 2: Create a module configuration file config.xml in /app/code/community/NAMESPACE/MODULENAME/etc/ (replace NAMESPACE and MODULENAME with your own values). In our case the path will be /app/code/community/Atwix/Orderhook/etc/. config.xml content:

<?xml version="1.0"?>

Step 3 Create observer file app/code/community/Atwix/Orderhook/Model/Observer.php with the following content:

class Atwix_Orderhook_Model_Observer 
    public function implementOrderStatus($event)
        $order = $event->getOrder();
        if ($this->_getPaymentMethod($order) == 'banktransfer') {
            if ($order->canInvoice())
        return $this;
    private function _getPaymentMethod($order)
        return $order->getPayment()->getMethodInstance()->getCode();
    private function _processOrderStatus($order)
        $invoice = $order->prepareInvoice();
      /*  Mage::getModel('core/resource_transaction')
        $invoice->sendEmail(true, '');
        return true;
    private function _changeOrderStatus($order)
        $statusMessage = '';
        $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);        

Save this module and clear your cache. For more see here.

  • The order status went to "pending" however it still went to "processing". I'll post a screenshot in my question.
    – p_jk
    May 30, 2016 at 9:20
  • Make sure this module is working add Mage::log('working',null,'pay.log'); in implementOrderStatus function and see log folder
    – Arunendra
    May 30, 2016 at 9:57
  • Yes, it worked and it created the pay.log file. The screenshot I posted has 2 "pending" statuses. The second "pending" status was because of the code you suggested. I think the observer should be called after "processing" status? I also have a feeling that it goes to "processing" because it auto generates an invoice however I can't find a way to try that yet (can't find anything in google lol). I had typo with this comment I just updated it.
    – p_jk
    May 30, 2016 at 10:26
  • comment Mage::getModel('core/resource_transaction') ->addObject($invoice) ->addObject($invoice->getOrder()) ->save(); this line
    – Arunendra
    May 30, 2016 at 10:27
  • please see the updated the answer
    – Arunendra
    May 30, 2016 at 10:28

Your Answer

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

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