I want to add a custom attribute in product collection
protected function _getProductCollection()
{
parent::__construct();
$products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSort("entity_id","DESC")
->addAttributeToSelect('*')
->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds())
->setPageSize($this->get_prod_count())
->addAttributeToSort($this->get_order(), $this->get_order_dir())
->setCurPage($this->get_cur_page());
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
$this->_productCollection = $products;
return $this->_productCollection;
}
In this collection will display all new product. But i want to restrict if newproduct_display_homepage = yes
then only display. how to add this filter into that