//get all order statuses and save the array $orderStatus[status][label] //in $status associative array $orderStatusCollection = Mage::getModel('sales/order_status')->getResourceCollection()->getData(); $status = array(); $status= array( '-1'=>'Please Select..' ); foreach($orderStatusCollection as $orderStatus) { $status[] = array ( 'value' => $orderStatus['status'], 'label' => $orderStatus['label’] ); }
If we wanted to add the order status in admin grid, we then need to do the following,
//get all order statuses and save the array $orderStatus[status][label] //in $orderStatusOptions[] $orderStatusCollection = Mage::getModel('sales/order_status')->getResourceCollection()->getData(); foreach($orderStatusCollection as $orderStatus) { $orderStatusOptions[$orderStatus['status']] = $orderStatus['label’]; }