Public Member Functions | |
getEstimateRates () | |
getAddress () | |
getCarrierName ($carrierCode) | |
getAddressShippingMethod () | |
getEstimateCountryId () | |
getEstimatePostcode () | |
getEstimateCity () | |
getEstimateRegionId () | |
getEstimateRegion () | |
getCityActive () | |
getStateActive () | |
formatPrice ($price) | |
getShippingPrice ($price, $flag) | |
getCarriers () | |
isStateProvinceRequired () | |
isCityRequired () | |
isZipCodeRequired () | |
Protected Attributes | |
$_carriers = null | |
$_rates = array() | |
$_address = array() |
Definition at line 28 of file Shipping.php.
formatPrice | ( | $ | price | ) |
Definition at line 104 of file Shipping.php.
00105 { 00106 return $this->getQuote()->getStore()->convertPrice($price, true); 00107 }
getAddress | ( | ) |
Get address model
Definition at line 48 of file Shipping.php.
00049 { 00050 if (empty($this->_address)) { 00051 $this->_address = $this->getQuote()->getShippingAddress(); 00052 } 00053 return $this->_address; 00054 }
getAddressShippingMethod | ( | ) |
Definition at line 64 of file Shipping.php.
00065 { 00066 return $this->getAddress()->getShippingMethod(); 00067 }
getCarrierName | ( | $ | carrierCode | ) |
Definition at line 56 of file Shipping.php.
00057 { 00058 if ($name = Mage::getStoreConfig('carriers/'.$carrierCode.'/title')) { 00059 return $name; 00060 } 00061 return $carrierCode; 00062 }
getCarriers | ( | ) |
Obtain available carriers instances
Definition at line 119 of file Shipping.php.
00120 { 00121 if (null === $this->_carriers) { 00122 $this->_carriers = array(); 00123 $this->getEstimateRates(); 00124 foreach ($this->_rates as $rateGroup) { 00125 if (!empty($rateGroup)) { 00126 foreach ($rateGroup as $rate) { 00127 $this->_carriers[] = $rate->getCarrierInstance(); 00128 } 00129 } 00130 } 00131 } 00132 return $this->_carriers; 00133 }
getCityActive | ( | ) |
Definition at line 94 of file Shipping.php.
00095 { 00096 return (bool)Mage::getStoreConfig('carriers/dhl/active'); 00097 }
getEstimateCity | ( | ) |
Definition at line 79 of file Shipping.php.
00080 { 00081 return $this->getAddress()->getCity(); 00082 }
getEstimateCountryId | ( | ) |
Definition at line 69 of file Shipping.php.
00070 { 00071 return $this->getAddress()->getCountryId(); 00072 }
getEstimatePostcode | ( | ) |
Definition at line 74 of file Shipping.php.
00075 { 00076 return $this->getAddress()->getPostcode(); 00077 }
getEstimateRates | ( | ) |
Definition at line 34 of file Shipping.php.
00035 { 00036 if (empty($this->_rates)) { 00037 $groups = $this->getAddress()->getGroupedAllShippingRates(); 00038 $this->_rates = $groups; 00039 } 00040 return $this->_rates; 00041 }
getEstimateRegion | ( | ) |
Definition at line 89 of file Shipping.php.
00090 { 00091 return $this->getAddress()->getRegion(); 00092 }
getEstimateRegionId | ( | ) |
Definition at line 84 of file Shipping.php.
00085 { 00086 return $this->getAddress()->getRegionId(); 00087 }
getShippingPrice | ( | $ | price, | |
$ | flag | |||
) |
Definition at line 109 of file Shipping.php.
00110 { 00111 return $this->formatPrice($this->helper('tax')->getShippingPrice($price, $flag, $this->getAddress())); 00112 }
getStateActive | ( | ) |
Definition at line 99 of file Shipping.php.
00100 { 00101 return (bool)Mage::getStoreConfig('carriers/dhl/active') || (bool)Mage::getStoreConfig('carriers/tablerate/active'); 00102 }
isCityRequired | ( | ) |
Check if one of carriers require city
Definition at line 155 of file Shipping.php.
00156 { 00157 foreach ($this->getCarriers() as $carrier) { 00158 if ($carrier->isCityRequired()) { 00159 return true; 00160 } 00161 } 00162 return false; 00163 }
isStateProvinceRequired | ( | ) |
Check if one of carriers require state/province
Definition at line 140 of file Shipping.php.
00141 { 00142 foreach ($this->getCarriers() as $carrier) { 00143 if ($carrier->isStateProvinceRequired()) { 00144 return true; 00145 } 00146 } 00147 return false; 00148 }
isZipCodeRequired | ( | ) |
Check if one of carriers require zip code
Definition at line 170 of file Shipping.php.
00171 { 00172 foreach ($this->getCarriers() as $carrier) { 00173 if ($carrier->isZipCodeRequired()) { 00174 return true; 00175 } 00176 } 00177 return false; 00178 }
$_address = array() [protected] |
Definition at line 32 of file Shipping.php.
$_carriers = null [protected] |
Definition at line 30 of file Shipping.php.
$_rates = array() [protected] |
Definition at line 31 of file Shipping.php.