Mage_Adminhtml_Model_System_Config_Source_Shipping_Allmethods Class Reference

Inheritance diagram for Mage_Adminhtml_Model_System_Config_Source_Shipping_Allmethods:

Mage_Adminhtml_Model_System_Config_Source_Shipping_Allowedmethods

List of all members.

Public Member Functions

 toOptionArray ($isActiveOnlyFlag=false)


Detailed Description

Definition at line 27 of file Allmethods.php.


Member Function Documentation

toOptionArray ( isActiveOnlyFlag = false  ) 

Return array of carriers. If $isActiveOnlyFlag is set to true, will return only active carriers

Parameters:
bool $isActiveOnlyFlag
Returns:
array

Definition at line 36 of file Allmethods.php.

00037     {
00038         $methods = array(array('value'=>'', 'label'=>''));
00039         $carriers = Mage::getSingleton('shipping/config')->getAllCarriers();
00040         foreach ($carriers as $carrierCode=>$carrierModel) {
00041             if (!$carrierModel->isActive() && (bool)$isActiveOnlyFlag === true) {
00042                 continue;
00043             }
00044             $carrierMethods = $carrierModel->getAllowedMethods();
00045             if (!$carrierMethods) {
00046                 continue;
00047             }
00048             $carrierTitle = Mage::getStoreConfig('carriers/'.$carrierCode.'/title');
00049             $methods[$carrierCode] = array(
00050                 'label'   => $carrierTitle,
00051                 'value' => array(),
00052             );
00053             foreach ($carrierMethods as $methodCode=>$methodTitle) {
00054                 $methods[$carrierCode]['value'][] = array(
00055                     'value' => $carrierCode.'_'.$methodCode,
00056                     'label' => '['.$carrierCode.'] '.$methodTitle,
00057                 );
00058             }
00059         }
00060 
00061         return $methods;
00062     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:14 2009 for Magento by  doxygen 1.5.8