/** * Initialize product collection * * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection * @return Hackathon_ElasticgentoCore_Model_Catalog_Layer */ public function prepareProductCollection($collection) { $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addMinimalPrice()->addFinalPrice()->addTaxPercents()->setPageSize(0)->addUrlRewrite($this->getCurrentCategory()->getId()); $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds()); return $this; }