Magentoorders have different states for following their process (billed, shipped, refunded...) in the orderWorkflow. These states are not visible inMagentoback office. In fact, it is ordersstatusesthat are displayed in back office and not theirstates.
Each state can have one or several statuses and a status can have only one state. By default, statuses and states have often the same name, that is why it is a little confusing. Here is the list of statuses and states available by default.
State code | State name | Status code | Status name |
new | New | pending | Pending |
pending_payment | Pending Payment | pending_paypal pending_amazon_asp |
Pending PayPal Pending Amazon Simple Pay |
processing | Processing | processing | Processing |
complete | Complete | complete | Complete |
closed | Closed | closed | Closed |
canceled | Canceled | canceled | Canceled |
holded | On Hold | holded | On Hold |
For adding new status to a state, you just need to declare it inconfig.xmlfile
When we want to modify order status in some code, we have to be sure that current order state allows status wanted. It is possible to change both state and status withsetStatemethod
$statuscan also take false value in order to only set order state, or true value for setting status by taking first status associated to this state.
You can now adjust as you wish your order workflow in Magento.