/** * Prepare product collection * * @param Mage_CatalogSearch_Model_Resource_Advanced_Collection $collection * @return Mage_Catalog_Model_Layer */ public function prepareProductCollection($collection) { $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->setStore(Mage::app()->getStore())->addMinimalPrice()->addTaxPercents()->addStoreFilter(); Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection); Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection); return $this; }
/** * Prepare product collection * * @param Mage_CatalogSearch_Model_Resource_Advanced_Collection $collection * @return Mage_Catalog_Model_Layer */ public function prepareProductCollection($collection) { $collection->addAttributeToSelect(Mage::getSingleton('Mage_Catalog_Model_Config')->getProductAttributes())->setStore(Mage::app()->getStore())->addMinimalPrice()->addTaxPercents()->addStoreFilter()->setVisibility(Mage::getSingleton('Mage_Catalog_Model_Product_Visibility')->getVisibleInSearchIds()); return $this; }