Here is the code to add category filter on the product collection
$productcollection = Mage::getModel(‘catalog/product’)->getCollection();
$productcollection = $productcollection->addCategoryFilter(Mage::getModel(‘catalog/category’)->load($currcategory),true);
$productcollection = $productcollection->addAttributeToFilter(‘special_price’, array(‘gt’ => 0));
echo $productcollection->getSize();
No comments:
Post a Comment