protected function _getProductCollection() { if (!Mage::helper('searchanise/ApiSe')->checkSearchaniseResult(true)) { return parent::_getProductCollection(); } if (is_null($this->_productCollection)) { $tagModel = Mage::getModel('tag/tag'); $collection = $tagModel->getEntityCollection(); if (method_exists($collection, 'setSearchaniseRequest')) { $collection->setSearchaniseRequest(Mage::helper('searchanise')->getSearchaniseRequest()); } if (!method_exists($collection, 'checkSearchaniseResult') || !$collection->checkSearchaniseResult()) { return parent::_getProductCollection(); } $this->_productCollection = $collection; $this->_productCollection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addSearchaniseFilter()->addTagFilter($this->getTag()->getId())->addStoreFilter(Mage::app()->getStore()->getId())->addMinimalPrice()->addUrlRewrite()->setActiveFilter(); Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this->_productCollection); Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($this->_productCollection); } return $this->_productCollection; }