Get Category products count in Magento
Try below code :
<?php
$products = Mage::getModel('catalog/category')->load($_category->getId())
->getProductCollection()
->addAttributeToSelect('entity_id')
->addAttributeToFilter('status', 1)
->addAttributeToFilter('visibility', 4);
echo $products->count();
?>
No comments:
Post a Comment