Mage_Shipping_Block_Tracking_Popup Class Reference

Inheritance diagram for Mage_Shipping_Block_Tracking_Popup:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 setOrderId ($oid)
 getOrderId ()
 setShipId ($oid)
 getShipId ()
 setTrackId ($tid='')
 getTrackId ()
 getTrackingInfo ()
 getTrackingInfoByOrder ()
 getTrackingInfoByShip ()
 getTrackingInfoByTrackId ()
 formatDeliveryDateTime ($date, $time)
 formatDeliveryDate ($date)
 formatDeliveryTime ($time, $date=null)
 getStoreSupportEmail ()
 getContactUs ()

Protected Member Functions

 _initOrder ()
 _initShipment ()

Protected Attributes

 $_track_id
 $_order_id
 $_ship_id


Detailed Description

Definition at line 27 of file Popup.php.


Member Function Documentation

_initOrder (  )  [protected]

Initialize order model instance

Returns:
Mage_Sales_Model_Order || false

Definition at line 69 of file Popup.php.

00070     {
00071         $order = Mage::getModel('sales/order')->load($this->_order_id);
00072 
00073         if (!$order->getId()) {
00074             return false;
00075         }
00076 
00077         return $order;
00078     }

_initShipment (  )  [protected]

Initialize ship model instance

Returns:
Mage_Sales_Model_Order_Shipment || false

Definition at line 85 of file Popup.php.

00086     {
00087         $ship = Mage::getModel('sales/order_shipment')->load($this->_ship_id);
00088 
00089         if (!$ship->getEntityId()) {
00090             return false;
00091         }
00092 
00093         return $ship;
00094     }

formatDeliveryDate ( date  ) 

Definition at line 175 of file Popup.php.

00176     {
00177         return Mage::app()->getLocale()->date(strtotime($date),Zend_Date::TIMESTAMP, null, false)->toString('MM/dd/YYYY');
00178     }

formatDeliveryDateTime ( date,
time 
)

Definition at line 167 of file Popup.php.

00168     {
00169         return Mage::app()->getLocale()->date(strtotime($date.' '.$time),Zend_Date::TIMESTAMP, null, false)->toString('MM/dd/YYYY hh:mm a');
00170     }

formatDeliveryTime ( time,
date = null 
)

Definition at line 183 of file Popup.php.

00184     {
00185         if (!empty($date)) {
00186             $time = $date.' '.$time;
00187         }
00188         return Mage::app()->getLocale()->date(strtotime($time),Zend_Date::TIMESTAMP, null, false)->toString('hh:mm a');
00189     }

getContactUs (  ) 

Definition at line 196 of file Popup.php.

00197     {
00198         return $this->getUrl('contacts');
00199     }

getOrderId (  ) 

Definition at line 39 of file Popup.php.

00040     {
00041         return $this->_order_id;
00042     }

getShipId (  ) 

Definition at line 49 of file Popup.php.

00050     {
00051         return $this->_ship_id;
00052     }

getStoreSupportEmail (  ) 

Definition at line 191 of file Popup.php.

00192     {
00193         return Mage::getStoreConfig('trans_email/ident_support/email');
00194     }

getTrackId (  ) 

Definition at line 59 of file Popup.php.

00060     {
00061         return $this->_track_id;
00062     }

getTrackingInfo (  ) 

Definition at line 97 of file Popup.php.

00098     {
00099         $this->setOrderId($this->getRequest()->getParam('order_id'));
00100         $this->setTrackId($this->getRequest()->getParam('track_id'));
00101         $this->setShipId($this->getRequest()->getParam('ship_id'));
00102 
00103         if ($this->getOrderId()>0) {
00104             return $this->getTrackingInfoByOrder();
00105         } elseif($this->getShipId()>0) {
00106             return $this->getTrackingInfoByShip();
00107         } else {
00108             return $this->getTrackingInfoByTrackId();
00109         }
00110     }

getTrackingInfoByOrder (  ) 

Definition at line 115 of file Popup.php.

00116     {
00117         $shipTrack = array();
00118         if ($order = $this->_initOrder()) {
00119             $shipments = $order->getShipmentsCollection();
00120             foreach ($shipments as $shipment){
00121                 $increment_id = $shipment->getIncrementId();
00122                 $tracks = $shipment->getTracksCollection();
00123 
00124                 $trackingInfos=array();
00125                 foreach ($tracks as $track){
00126                     $trackingInfos[] = $track->getNumberDetail();
00127                 }
00128                 $shipTrack[$increment_id] = $trackingInfos;
00129             }
00130         }
00131         return $shipTrack;
00132     }

getTrackingInfoByShip (  ) 

Definition at line 137 of file Popup.php.

00138     {
00139         $shipTrack = array();
00140         if ($shipment = $this->_initShipment()) {
00141             $increment_id = $shipment->getIncrementId();
00142             $tracks = $shipment->getTracksCollection();
00143 
00144             $trackingInfos=array();
00145             foreach ($tracks as $track){
00146                 $trackingInfos[] = $track->getNumberDetail();
00147             }
00148             $shipTrack[$increment_id] = $trackingInfos;
00149 
00150         }
00151         return $shipTrack;
00152     }

getTrackingInfoByTrackId (  ) 

Definition at line 157 of file Popup.php.

00158     {
00159         $shipTrack[] = array(Mage::getModel('sales/order_shipment_track')->load($this->getTrackId())
00160                        ->getNumberDetail());
00161         return $shipTrack;
00162     }

setOrderId ( oid  ) 

Definition at line 34 of file Popup.php.

00035     {
00036         $this->_order_id=$oid;
00037     }

setShipId ( oid  ) 

Definition at line 44 of file Popup.php.

00045     {
00046         $this->_ship_id=$oid;
00047     }

setTrackId ( tid = ''  ) 

Definition at line 54 of file Popup.php.

00055     {
00056         $this->_track_id=$tid;
00057     }


Member Data Documentation

$_order_id [protected]

Definition at line 31 of file Popup.php.

$_ship_id [protected]

Definition at line 32 of file Popup.php.

$_track_id [protected]

Definition at line 30 of file Popup.php.


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

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