Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7161011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:29:36+00:00 2026-05-28T13:29:36+00:00

Mage v1.6 i’d like to modify the checkmo payment method to allow an order

  • 0

Mage v1.6

i’d like to modify the checkmo payment method to allow an order to be promoted to the processing state upon creation. I’ve found that by changing the /app/code/core/Mage/Payment/etc/system.xml (yes, just fiddling with core now on test server, will modify it properly if it works) file here:

<checkmo translate="label">
  <fields>
    <order_status translate="label">
      <source_model>adminhtml/system_config_source_order_status_new</source_model>

by removing the “new” in the source_model you can select an order status in the configuration that belongs to the processing state.

However, the orders are not really in the processing state. They remain in the new/pending state, but the status is one from the processing state. A weird hybrid.

This doesn’t quite work, since my goal is to be able to easily switch an order between the 4 custom order statuses i have made for the processing state. the reason is to get all orders, check or CC to be in the same state so they can be treated similarly. the Authnet module puts the CC orders in the processing state, and I want the checkmo orders to join them. (conversely, if I could make the CC orders go to the new/pending state, I can assign my custom statuses to that state) Either way, I need all new orders to be in the same state upon creation regardless of invoice or shipment existence.

thanks

note: these related questions do not quite address this issue : 6095096, 6415547, 4170628)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:29:37+00:00Added an answer on May 28, 2026 at 1:29 pm

    The important action of setting the order status is handled in Mage_Sales_Model_Order_Payment::Place():

    ...
    $orderState = Mage_Sales_Model_Order::STATE_NEW;
    ...
    $orderStatus = $methodInstance->getConfigData('order_status');
    ...
    $order->setState($orderState, $orderStatus, $message, $isCustomerNotified);
    ...
    

    However, in Mage_Sales_Model_Order::setState(), it doesn’t check for relationship between order state and order status. Hence, the weird hybrid.

    There are many ways to work around this, one is to add observer for event ‘checkout_type_onepage_save_order_after’ and reset the status there. My preferred method is to add a callback in the payment method model:

    class Celera_AaCredit_Model_Payment extends Mage_Payment_Model_Method_Abstract
    {
    protected $_code  = 'aa_credit'; 
    protected $_isInitializeNeeded = true; //Required for the initialize() callback to happen 
    
    /* Workaround to assign the correct order state to the corresponding status set in system config */
    
    /**
     * Invoke in Mage_Sales_Model_Order_Payment
     * Required for the initialize() callback to happen     
     *      
     * @return string
     */                 
    public function getConfigPaymentAction()
    {
        return 'init'; //set flag to initialize $this after order is created and the payment is placed
    }
    
    /**
     * Update order state to system configuration 
     *
     * @return Mage_Payment_Model_Method_Abstract
    */ 
    public function initialize($action, $stateObject)
    {                          
        if ($status = $this->getConfigData('order_status')) {
            $stateObject->setStatus($status);
            $state = $this->_getAssignedState($status);
            $stateObject->setState($state);
            $stateObject->setIsNotified(true);            
        }
        return $this;
    }
    
    /**
     * Get the assigned state of an order status
     *     
     * @param string order_status
     */              
    protected function _getAssignedState($status)
    {
        $item = Mage::getResourceModel('sales/order_status_collection')
                  ->joinStates()
                  ->addFieldToFilter('main_table.status', $status)
                  ->getFirstItem();
        return $item->getState();
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm loading an order like this: $order = Mage::getModel('sales/order')->load(2886); $items = $order->getAllItems(); Then I
I have a Magento order model that I create like this: $order = Mage::getModel('sales/order')->load($orderId);
I would like to rewrite the collection that is returned by Mage::getResourceModel('sales/order_collection'); My goal
I can get countries like this: $countryCollection = Mage::getModel('directory/country')->getResourceCollection()->loadByStore(); And they are listed somewhere
I found many code snippets in Magento such as $variable_name = Mage::app()->function_name(); here's an
Right now i am deleting data like $deleteCCL = Mage::getModel('crossdata/customccitem'); $deleteCCL->load($itemId); $deleteCCL->delete(); Is there
Why IE not showing BG mage like firefox in Iframe? I do not have
I would like to retrieve the 'Minimum order amount' value for free shipping in
According to the FAQ to GoDaddy they support SignTool from Microsoft, but mage.exe isn't
We are using Mage.exe to generate our application's manifests as part of our build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.