/** * Prepare collection * * @return Mage_Adminhtml_Block_Widget_Grid */ protected function _prepareCollection() { $collection = Mage::getModel('catalog/product_link')->useRelatedLinks()->getProductCollection()->setProduct($this->_getProduct())->addAttributeToSelect('*'); if ($this->isReadonly()) { $productIds = $this->_getSelectedProducts(); if (empty($productIds)) { $productIds = array(0); } $collection->addFieldToFilter('entity_id', array('in' => $productIds)); } $this->setCollection($collection); return parent::_prepareCollection(); }