Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Shipping_Block_Tracking_Ajax
  • Mage_Shipping_Block_Tracking_Popup
  • Mage_Shipping_Exception
  • Mage_Shipping_Helper_Data
  • Mage_Shipping_Model_Carrier_Abstract
  • Mage_Shipping_Model_Carrier_Flatrate
  • Mage_Shipping_Model_Carrier_Freeshipping
  • Mage_Shipping_Model_Carrier_Pickup
  • Mage_Shipping_Model_Carrier_Tablerate
  • Mage_Shipping_Model_Config
  • Mage_Shipping_Model_Info
  • Mage_Shipping_Model_Mysql4_Carrier_Tablerate
  • Mage_Shipping_Model_Mysql4_Carrier_Tablerate_Collection
  • Mage_Shipping_Model_Rate_Abstract
  • Mage_Shipping_Model_Rate_Request
  • Mage_Shipping_Model_Rate_Result
  • Mage_Shipping_Model_Rate_Result_Abstract
  • Mage_Shipping_Model_Rate_Result_Error
  • Mage_Shipping_Model_Rate_Result_Method
  • Mage_Shipping_Model_Resource_Carrier_Tablerate
  • Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection
  • Mage_Shipping_Model_Shipment_Request
  • Mage_Shipping_Model_Shipment_Return
  • Mage_Shipping_Model_Shipping
  • Mage_Shipping_Model_Source_HandlingAction
  • Mage_Shipping_Model_Source_HandlingType
  • Mage_Shipping_Model_Tracking_Result
  • Mage_Shipping_Model_Tracking_Result_Abstract
  • Mage_Shipping_Model_Tracking_Result_Error
  • Mage_Shipping_Model_Tracking_Result_Status

Interfaces

  • Mage_Shipping_Model_Carrier_Interface
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Shipping
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: class Mage_Shipping_Block_Tracking_Popup extends Mage_Core_Block_Template
 28: {
 29:     /**
 30:      * @deprecated after 1.3.2.3
 31:      */
 32:     protected $_track_id;
 33:     /**
 34:      * @deprecated after 1.3.2.3
 35:      */
 36:     protected $_order_id;
 37:     /**
 38:      * @deprecated after 1.3.2.3
 39:      */
 40:     protected $_ship_id;
 41: 
 42:     /**
 43:      * @deprecated after 1.3.2.3
 44:      */
 45:     public function setOrderId($oid)
 46:     {
 47:         return $this->setData('order_id', $oid);
 48:     }
 49: 
 50:     /**
 51:      * @deprecated after 1.3.2.3
 52:      */
 53:     public function getOrderId()
 54:     {
 55:         return $this->_getData('order_id');
 56:     }
 57: 
 58:     /**
 59:      * @deprecated after 1.3.2.3
 60:      */
 61:     public function setShipId($oid)
 62:     {
 63:         return $this->setData('ship_id', $oid);
 64:     }
 65: 
 66:     /**
 67:      * @deprecated after 1.3.2.3
 68:      */
 69:     public function getShipId()
 70:     {
 71:         return $this->_getData('ship_id');
 72:     }
 73: 
 74:     /**
 75:      * @deprecated after 1.3.2.3
 76:      */
 77:     public function setTrackId($tid='')
 78:     {
 79:         return $this->setData('track_id', $tid);
 80:     }
 81: 
 82:     /**
 83:      * @deprecated after 1.3.2.3
 84:      */
 85:     public function getTrackId()
 86:     {
 87:         return $this->_getData('track_id');
 88:     }
 89: 
 90:      /**
 91:       * @deprecated after 1.4.0.0-alpha3
 92:       * Initialize order model instance
 93:       *
 94:       * @return Mage_Sales_Model_Order || false
 95:       */
 96:     protected function _initOrder()
 97:     {
 98:         $order = Mage::getModel('sales/order')->load($this->getOrderId());
 99: 
100:         if (!$order->getId() || $this->getProtectCode() != $order->getProtectCode()) {
101:             return false;
102:         }
103: 
104:         return $order;
105:     }
106: 
107:     /**
108:      * @deprecated after 1.4.0.0-alpha3
109:      * Initialize ship model instance
110:      *
111:      * @return Mage_Sales_Model_Order_Shipment || false
112:      */
113:     protected function _initShipment()
114:     {
115:         $ship = Mage::getModel('sales/order_shipment')->load($this->getShipId());
116: 
117:         if (!$ship->getEntityId() || $this->getProtectCode() != $ship->getProtectCode()) {
118:             return false;
119:         }
120: 
121:         return $ship;
122:     }
123: 
124: 
125:     /**
126:      * Retrieve array of tracking info
127:      *
128:      * @return array
129:      */
130:     public function getTrackingInfo()
131:     {
132:         /* @var $info Mage_Shipping_Model_Info */
133:         $info = Mage::registry('current_shipping_info');
134: 
135:         return $info->getTrackingInfo();
136:     }
137: 
138:     /**
139:      * @deprecated after 1.4.0.0-alpha3
140:      * Retrieve all tracking by orders id
141:      *
142:      * @return array
143:      */
144:     public function getTrackingInfoByOrder()
145:     {
146:         $shipTrack = array();
147:         if ($order = $this->_initOrder()) {
148:             $shipments = $order->getShipmentsCollection();
149:             foreach ($shipments as $shipment){
150:                 $increment_id = $shipment->getIncrementId();
151:                 $tracks = $shipment->getTracksCollection();
152: 
153:                 $trackingInfos=array();
154:                 foreach ($tracks as $track){
155:                     $trackingInfos[] = $track->getNumberDetail();
156:                 }
157:                 $shipTrack[$increment_id] = $trackingInfos;
158:             }
159:         }
160:         return $shipTrack;
161:     }
162: 
163:     /**
164:      * @deprecated after 1.4.0.0-alpha3
165:      * Retrieve all tracking by ship id
166:      *
167:      * @return array
168:      */
169:     public function getTrackingInfoByShip()
170:     {
171:         $shipTrack = array();
172:         if ($shipment = $this->_initShipment()) {
173:             $increment_id = $shipment->getIncrementId();
174:             $tracks = $shipment->getTracksCollection();
175: 
176:             $trackingInfos=array();
177:             foreach ($tracks as $track){
178:                 $trackingInfos[] = $track->getNumberDetail();
179:             }
180:             $shipTrack[$increment_id] = $trackingInfos;
181: 
182:         }
183:         return $shipTrack;
184:     }
185: 
186:     /**
187:      * @deprecated after 1.4.0.0-alpha3
188:      * Retrieve tracking by tracking entity id
189:      *
190:      * @return array
191:      */
192:     public function getTrackingInfoByTrackId()
193:     {
194:         $track = Mage::getModel('sales/order_shipment_track')->load($this->getTrackId());
195:         if ($this->getProtectCode() == $track->getProtectCode()) {
196:             return array(array($track->getNumberDetail()));
197:         }
198:         return array(array());
199:     }
200: 
201:     /**
202:      * Format given date and time in current locale without changing timezone
203:      *
204:      * @param string $date
205:      * @param string $time
206:      * @return string
207:      */
208:     public function formatDeliveryDateTime($date, $time)
209:     {
210:         return $this->formatDeliveryDate($date) . ' ' . $this->formatDeliveryTime($time);
211:     }
212: 
213:     /**
214:      * Format given date in current locale without changing timezone
215:      *
216:      * @param string $date
217:      * @return string
218:      */
219:     public function formatDeliveryDate($date)
220:     {
221:         /* @var $locale Mage_Core_Model_Locale */
222:         $locale = Mage::app()->getLocale();
223:         $format = $locale->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
224:         return $locale->date(strtotime($date), Zend_Date::TIMESTAMP, null, false)
225:             ->toString($format);
226:     }
227: 
228:     /**
229:      * Format given time [+ date] in current locale without changing timezone
230:      *
231:      * @param string $time
232:      * @param string $date
233:      * @return string
234:      */
235:     public function formatDeliveryTime($time, $date = null)
236:     {
237:         if (!empty($date)) {
238:             $time = $date . ' ' . $time;
239:         }
240:         
241:         /* @var $locale Mage_Core_Model_Locale */
242:         $locale = Mage::app()->getLocale();
243:         
244:         $format = $locale->getTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
245:         return $locale->date(strtotime($time), Zend_Date::TIMESTAMP, null, false)
246:             ->toString($format);
247:     }
248: 
249:     /**
250:      * Is 'contact us' option enabled?
251:      *
252:      * @return boolean
253:      */
254:     public function getContactUsEnabled()
255:     {
256:         return (bool) Mage::getStoreConfig('contacts/contacts/enabled');
257:     }
258: 
259:     public function getStoreSupportEmail()
260:     {
261:         return Mage::getStoreConfig('trans_email/ident_support/email');
262:     }
263: 
264:     public function getContactUs()
265:     {
266:         return $this->getUrl('contacts');
267:     }
268: 
269: }
270: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0