Public Member Functions | |
getActiveCarriers ($store=null) | |
getAllCarriers ($store=null) | |
getCarrierInstance ($carrierCode, $store=null) | |
Protected Member Functions | |
_getCarrier ($code, $config, $store=null) | |
Static Protected Attributes | |
static | $_carriers |
Definition at line 28 of file Config.php.
_getCarrier | ( | $ | code, | |
$ | config, | |||
$ | store = null | |||
) | [protected] |
Definition at line 82 of file Config.php.
00083 { 00084 /* 00085 if (isset(self::$_carriers[$code])) { 00086 return self::$_carriers[$code]; 00087 } 00088 */ 00089 if (!isset($config['model'])) { 00090 throw Mage::exception('Mage_Shipping', 'Invalid model for shipping method: '.$code); 00091 } 00092 $modelName = $config['model']; 00093 $carrier = Mage::getModel($modelName); 00094 $carrier->setId($code)->setStore($store); 00095 self::$_carriers[$code] = $carrier; 00096 return self::$_carriers[$code]; 00097 }
getActiveCarriers | ( | $ | store = null |
) |
Retrieve active system carriers
mixed | $store |
Definition at line 38 of file Config.php.
00039 { 00040 $carriers = array(); 00041 $config = Mage::getStoreConfig('carriers', $store); 00042 foreach ($config as $code => $carrierConfig) { 00043 if (Mage::getStoreConfigFlag('carriers/'.$code.'/active', $store)) { 00044 $carriers[$code] = $this->_getCarrier($code, $carrierConfig, $store); 00045 } 00046 } 00047 return $carriers; 00048 }
getAllCarriers | ( | $ | store = null |
) |
Retrieve all system carriers
mixed | $store |
Definition at line 56 of file Config.php.
00057 { 00058 $carriers = array(); 00059 $config = Mage::getStoreConfig('carriers', $store); 00060 foreach ($config as $code => $carrierConfig) { 00061 $carriers[$code] = $this->_getCarrier($code, $carrierConfig, $store); 00062 } 00063 return $carriers; 00064 }
getCarrierInstance | ( | $ | carrierCode, | |
$ | store = null | |||
) |
Retrieve carrier model instance by carrier code
string | $carrierCode | |
mixed | $store |
Definition at line 73 of file Config.php.
00074 { 00075 $carrierConfig = Mage::getStoreConfig('carriers/'.$carrierCode, $store); 00076 if (!empty($carrierConfig)) { 00077 return $this->_getCarrier($carrierCode, $carrierConfig, $store); 00078 } 00079 return false; 00080 }
$_carriers [static, protected] |
Definition at line 30 of file Config.php.