Mage_Usa_Model_Shipping_Carrier_Abstract Class Reference

Inheritance diagram for Mage_Usa_Model_Shipping_Carrier_Abstract:

Mage_Shipping_Model_Carrier_Abstract Varien_Object Mage_Usa_Model_Shipping_Carrier_Dhl Mage_Usa_Model_Shipping_Carrier_Fedex Mage_Usa_Model_Shipping_Carrier_Ups Mage_Usa_Model_Shipping_Carrier_Usps

List of all members.

Public Member Functions

 getTrackingInfo ($tracking)
 isTrackingAvailable ()
 isCityRequired ()
 isZipCodeRequired ()
 proccessAdditionalValidation (Mage_Shipping_Model_Rate_Request $request)

Public Attributes

const USA_COUNTRY_ID = 'US'
const PUERTORICO_COUNTRY_ID = 'PR'


Detailed Description

Abstract USA shipping carrier model

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Abstract.php.


Member Function Documentation

getTrackingInfo ( tracking  ) 

Definition at line 38 of file Abstract.php.

00039     {
00040         $info = array();
00041 
00042         $result = $this->getTracking($tracking);
00043 
00044         if($result instanceof Mage_Shipping_Model_Tracking_Result){
00045             if ($trackings = $result->getAllTrackings()) {
00046                 return $trackings[0];
00047             }
00048         }
00049         elseif (is_string($result) && !empty($result)) {
00050             return $result;
00051         }
00052 
00053         return false;
00054     }

isCityRequired (  ) 

Reimplemented from Mage_Shipping_Model_Carrier_Abstract.

Definition at line 67 of file Abstract.php.

00068     {
00069         return true;
00070     }

isTrackingAvailable (  ) 

Check if carrier has shipping tracking option available All Mage_Usa carriers have shipping tracking option available

Returns:
boolean

Reimplemented from Mage_Shipping_Model_Carrier_Abstract.

Definition at line 62 of file Abstract.php.

00063     {
00064         return true;
00065     }

isZipCodeRequired (  ) 

Reimplemented from Mage_Shipping_Model_Carrier_Abstract.

Definition at line 72 of file Abstract.php.

00073     {
00074         return true;
00075     }

proccessAdditionalValidation ( Mage_Shipping_Model_Rate_Request request  ) 

Processing additional validation to check is carrier applicable.

Parameters:
Mage_Shipping_Model_Rate_Request $request
Returns:
Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean

Reimplemented from Mage_Shipping_Model_Carrier_Abstract.

Definition at line 83 of file Abstract.php.

00084     {
00085         $maxAllowedWeight = (float) $this->getConfigData('max_package_weight');
00086         $error = null;
00087         $showMethod = $this->getConfigData('showmethod');
00088         foreach ($request->getAllItems() as $item) {
00089             if ($item->getProduct() && $item->getProduct()->getId()) {
00090                 if ($item->getProduct()->getWeight() > $maxAllowedWeight) {
00091                     $error = Mage::getModel('shipping/rate_result_error');
00092                     $error->setCarrier($this->_code)
00093                         ->setCarrierTitle($this->getConfigData('title'));
00094                     $errorMsg = $this->getConfigData('specificerrmsg');
00095                     $error->setErrorMessage($errorMsg?$errorMsg:Mage::helper('shipping')->__('The shipping module is not available.'));
00096                     break;
00097                 }
00098             }
00099         }
00100         if (null !== $error && $showMethod) {
00101             return $error;
00102         } elseif (null !== $error) {
00103             return false;
00104         }
00105         return $this;
00106     }


Member Data Documentation

const PUERTORICO_COUNTRY_ID = 'PR'

Definition at line 36 of file Abstract.php.

const USA_COUNTRY_ID = 'US'

Definition at line 35 of file Abstract.php.


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

Generated on Sat Jul 4 17:24:55 2009 for Magento by  doxygen 1.5.8