I have override magento layer.php file and need to change some method. just like below.
public function getProductCollection()
{
if($this->getCurrentCategory()->getId()==290){
$startprice=0;
$endprice=499;
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('price', array('gteq' => $startprice))
->addAttributeToFilter('price', array('lteq' => $endprice))
->getData();
}else{
if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
$collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
} else {
$collection = $this->getCurrentCategory()->getProductCollection();
$this->prepareProductCollection($collection);
$this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
}
}
return $collection;
}
After this changes got the following error. how to solve this.
Fatal error: Call to a member function getSetIds() on a non-object in /var/www/html/app/code/core/Mage/Catalog/Model/Layer.php on line 306
Thanks.