Magento获取所有订单状态
//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’]
);
}
如果我们想在管理网格中添加订单状态,则需要执行以下操作,
//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’];