Which of the following will retrieve a list of all shipping methods in Magento?
Answer
Correct Answer: public function toOptionArray($isMultiSelect = false) { $methods = Mage::getSingleton('shipping/config')->getActiveCarriers(); $options = array(); foreach($methods as $_code => $_method) { if(!$_title = Mage::getStoreConfig("carriers/$_code/title")) $_title = $_code; $options[] = array('value' => $_code, 'label' => $_title . " ($_code)"); } if($isMultiSelect) { array_unshift($options, array('value'=>'', 'label'=> Mage::helper('adminhtml')->__('--Please Select--'))); } return $options; }
Explanation:
Note: This Question is unanswered, help us to find answer for this one