Пример #1
0
 /**
  * Get tracking response
  *
  * @return string
  */
 public function getResponse()
 {
     $statuses = '';
     if ($this->_result instanceof Mage_Shipping_Model_Tracking_Result) {
         if ($trackings = $this->_result->getAllTrackings()) {
             foreach ($trackings as $tracking) {
                 if ($data = $tracking->getAllData()) {
                     if (!empty($data['status'])) {
                         $statuses .= Mage::helper('usa')->__($data['status']) . "\n<br/>";
                     } else {
                         $statuses .= Mage::helper('usa')->__('Empty response') . "\n<br/>";
                     }
                 }
             }
         }
     }
     if (empty($statuses)) {
         $statuses = Mage::helper('usa')->__('Empty response');
     }
     return $statuses;
 }
Пример #2
0
 /**
  * Get tracking response
  *
  * @return string
  */
 public function getResponse()
 {
     $statuses = '';
     if ($this->_result instanceof Mage_Shipping_Model_Tracking_Result) {
         if ($trackings = $this->_result->getAllTrackings()) {
             foreach ($trackings as $tracking) {
                 if ($data = $tracking->getAllData()) {
                     if (isset($data['status'])) {
                         $statuses .= Mage::helper('Mage_Usa_Helper_Data')->__($data['status']);
                     } else {
                         $statuses .= Mage::helper('Mage_Usa_Helper_Data')->__($data['error_message']);
                     }
                 }
             }
         }
     }
     if (empty($statuses)) {
         $statuses = Mage::helper('Mage_Usa_Helper_Data')->__('Empty response');
     }
     return $statuses;
 }