Magento orders states and statuses

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.





$order = Mage::getModel('sales/order')->loadByIncrementId('100000001');
$state = 'processing';
$status = 'Payment After Cancelled';
$comment = 'Changing state to Processing and status to Payment After Cancelled ';
$isCustomerNotified = false;
$order->setState($state, $status, $comment, $isCustomerNotified);
$order->save();

$status can 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.

Comments

Popular Posts

Magmi Single and Multiple Category Importer