Public Member Functions | |
_construct () | |
setShipment (Mage_Sales_Model_Order_Shipment $shipment) | |
getShipment () | |
isCustom () | |
getNumberDetail () | |
getStore () | |
Public Attributes | |
const | CUSTOM_CARRIER_CODE = 'custom' |
Protected Attributes | |
$_shipment = null | |
$_eventPrefix = 'sales_order_shipment_track' | |
$_eventObject = 'track' |
Definition at line 27 of file Track.php.
_construct | ( | ) |
Initialize resource model
Reimplemented from Varien_Object.
Definition at line 38 of file Track.php.
00039 { 00040 $this->_init('sales/order_shipment_track'); 00041 }
getNumberDetail | ( | ) |
Retrieve detail for shipment track
Definition at line 79 of file Track.php.
00080 { 00081 $carrierInstance = Mage::getSingleton('shipping/config')->getCarrierInstance($this->getCarrierCode()); 00082 if (!$carrierInstance) { 00083 $custom['title'] = $this->getTitle(); 00084 $custom['number'] = $this->getNumber(); 00085 return $custom; 00086 } else { 00087 $carrierInstance->setStore($this->getStore()); 00088 } 00089 00090 if (!$trackingInfo = $carrierInstance->getTrackingInfo($this->getNumber())) { 00091 return Mage::helper('sales')->__('No detail for number "%s"', $this->getNumber()); 00092 } 00093 00094 return $trackingInfo; 00095 }
getShipment | ( | ) |
Retrieve Shipment instance
Definition at line 60 of file Track.php.
00061 { 00062 if (!($this->_shipment instanceof Mage_Sales_Model_Order_Shipment)) { 00063 $this->_shipment = Mage::getModel('sales/order_shipment')->load($this->getParentId()); 00064 } 00065 00066 return $this->_shipment; 00067 }
getStore | ( | ) |
Get store object
Reimplemented from Mage_Sales_Model_Abstract.
Definition at line 102 of file Track.php.
00103 { 00104 if ($this->getShipment()) { 00105 return $this->getShipment()->getStore(); 00106 } 00107 return Mage::app()->getStore(); 00108 }
isCustom | ( | ) |
setShipment | ( | Mage_Sales_Model_Order_Shipment $ | shipment | ) |
Declare Shipment instance
Mage_Sales_Model_Order_Shipment | $shipment |
Definition at line 49 of file Track.php.
$_eventObject = 'track' [protected] |
$_eventPrefix = 'sales_order_shipment_track' [protected] |
const CUSTOM_CARRIER_CODE = 'custom' |