In Magento, for most payment methods, you can assign an order status to a new order. You can do this in the system configuration for the specific payment method. But in a lot of cases, the only order status you can select here, is ‘Pending’.
But what if you want to assign a different order status to a new order? How can you increase the available order statuses in this dropdown? Well, it turns out that it’s very easy to accomplish this.
A simple solution
When you look at the system.xml -file of Magento’s default payment module, you’ll see that for the dropdown of each payment method a source model is used. The Bank Transfer payment method for example uses the source model adminhtml/system_config_source_order_status_new . So if we want to change the payment methods available in the dropdown, we have to assign a different source model. Lucky for us, Magento has a default source model with all order statuses, called adminhtml/system_config_source_order_status . So all we have to do is create our own module, with a simple system.xml -file that only overrides this configuration setting:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?xml version="1.0"?> <config> <sections> <payment> <groups> <banktransfer> <fields> <order_status> <!-- Changing the source model allows all order statuses to be selected for this payment method: --> <source_model>adminhtml/system_config_source_order_status</source_model> </order_status> </fields> </banktransfer> </groups> </payment> </sections> </config> |
And that’s it! Now the Bank Transfer payment method can have any order status for new orders. Sometimes it’s really that easy:
This is ideal for cases where you have to set the status of a new order to ‘Complete’ or any other status.
Visitors give this article an average rating of 3.6 out of 5.
How would you rate this article?
★ ★ ★ ★ ★
This works with just the basic default magento payments, but it does not work with paypal or authorize.net.
Do you know how to add the multiple status’s to new orders that come in from paypal and authorize.net in 1.9?
Thanks, Robert
Hi there,
I understand the whole thing but I don’t know how to “not” override the core xml.
Do I just create the folders within Local like app/code/local/Mage/Payment and place your system.xml file there?
I’m also dutch btw, maybe you can help me out..