/** * * @return Mage_Sales_Model_Resource_Order_Shipment_Grid_Collection */ public function getCollection() { $collection = parent::getCollection(); if ($collection && !$this->getIsI4ShipsJoined()) { /* @var $collection Mage_Sales_Model_Resource_Order_Shipment_Grid_Collection */ $resource = Mage::getSingleton('core/resource'); /* @var $resource Mage_Core_Model_Resource */ $shipsTableName = $resource->getTableName('zitec_dpd_ships'); $manifestTableName = $resource->getTableName('zitec_dpd_manifest'); $collection->getSelect()->joinLeft(array('ships' => $shipsTableName), 'ships.shipment_id = main_table.entity_id', array('zitec_manifest_id' => 'ships.manifest_id'))->joinLeft(array('manifest' => $manifestTableName), 'manifest.manifest_id = ships.manifest_id', array('zitec_manifest_ref' => 'manifest.manifest_ref')); $this->setIsI4ShipsJoined(true); } return $collection; }