1

My understanding of Order States and Order Statuses are that a given Order State can have one or more allowed Statuses. I've found that I can retrieve a list of all Statuses in the system using:

Mage::getSingleton('sales/order_config')->getStatuses();

However I need the list to be limited to statuses valid for a given State.

3

It occurred to me that Magento does this when viewing an Order in the backend; specifically the "Comments History" box has a dropdown populated with allowed Statuses for the given state.

Looking into that block turned up this solution:

public function getStatuses()
{
    $state = $this->getOrder()->getState();
    $statuses = $this->getOrder()->getConfig()->getStateStatuses($state);
    return $statuses;
}
  • 1
    This is right. It's essentially a resource model of sales/order_status_collection with filtering by the given state. Take a look at Mage_Sales_Model_Order_Config:: getStateStatuses(). – musicliftsme Oct 17 '14 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.