Showing posts with label state. Show all posts
Showing posts with label state. Show all posts

Wednesday, 13 May 2015

Get all statuses of particular state in Magento

Hi by below code you can get the all statuses of a particular state 

$complete_statuses = Mage::getResourceModel( 'sales/order_status_collection' )->joinStates()->addFieldToFilter('state','complete');
foreach ($complete_statuses as $complete_statuses_array ){
    $stausarray[] =  $complete_statuses_array->getStatus();
}


in this i have get the statuses of a complete state. You can replace  state
in ->addFieldToFilter('state','complete');  according to your needs