Setting new orders to Complete (or any other status) in Magento

Aug 4, 2011

How to: MagentoMagento brilliantly provides a configuration option for each of the built-in payment methods to allow you to set the orders status – unfortunately by default the only option you can pick is pending.

Each of Magento’s payment methods are created by the core payment module or as their own modules such as paypal – you can find the core methods in the folder app/code/core/Mage/Payment.

If you take a look in the system.xml configuration file – inside the etc folder then you will find some way down the field definition for the new order status field that you see in the admin. Each of the payment methods has this repeated…

<order_status translate="label">
   <label>New Order Status</label>
   <frontend_type>select</frontend_type>
   <source_model>adminhtml/system_config_source_order_status_new</source_model>
   <sort_order>2</sort_order>
   <show_in_default>1</show_in_default>
   <show_in_website>1</show_in_website>
   <show_in_store>0</show_in_store>
</order_status>

The important bit here is the source_model emelement. By changing the content of this element to the following you will get all of the order status’ in the dropdown.

<source_model>adminhtml/system_config_source_order_status</source_model>

Obviously you don’t want to be messing around changing the core files themselves – so create a module and override this in its own etc/system.xml file.

For other modules – they may do this slightly differently but if you search for order_status or adminhtml/system_config_source_order_status you should be able to find the important line and change it.