Example #1
0
 /**
  * Retrieve required options from parent
  */
 protected function _beforeToHtml()
 {
     if (!$this->getParentBlock()) {
         Mage::throwException(Mage::helper('adminhtml')->__('Invalid parent block for this block.'));
     }
     $this->setSubscription($this->getParentBlock()->getSubscription());
     $orderInfos = $this->getSubscription()->getOrderInfo();
     $order = Mage::getModel('sales/order')->setData($orderInfos)->setId(null);
     $this->setOrder($order);
     parent::_beforeToHtml();
 }
Example #2
0
 /**
  * Load all tracks and save it to local cache by shipments
  *
  * @return Mage_Sales_Block_Order_Print_Shipment
  */
 protected function _beforeToHtml()
 {
     $tracksCollection = $this->getOrder()->getTracksCollection();
     foreach ($tracksCollection->getItems() as $track) {
         $shipmentId = $track->getParentId();
         $this->_tracks[$shipmentId][] = $track;
     }
     $shipment = Mage::registry('current_shipment');
     if ($shipment) {
         $this->_shipmentsCollection = array($shipment);
     } else {
         $this->_shipmentsCollection = $this->getOrder()->getShipmentsCollection();
     }
     return parent::_beforeToHtml();
 }
Example #3
0
 /**
  * Initialize data and prepare it for output
  */
 protected function _beforeToHtml()
 {
     $this->_prepareLastOrder();
     return parent::_beforeToHtml();
 }