3 deleted 4 characters in body
source | link

Try this one:

    $categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('level', 2)
    ->addAttributeToSelect('is_active', 1)
    ->setLoadProductCount(true);

foreach ($categories as $category) {
    echo $category->getProductCount();
} 

Try this one:

    $categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('level', 2)
    ->addAttributeToSelect('is_active', 1)
    ->setLoadProductCount(true);

foreach ($categories as $category) {
    echo $category->getProductCount();
} 

Try this one:

$categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('level', 2)
    ->addAttributeToSelect('is_active', 1)
    ->setLoadProductCount(true);

foreach ($categories as $category) {
    echo $category->getProductCount();
} 
2 added 6 characters in body
source | link

Try this one:

$categories = Mage::getModel('catalog/category')->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('level', 2) ->addAttributeToSelect('is_active', 1) ->setLoadProductCount(true); foreach ($categories as $category) { echo $category->getProductCount(); }$

    $categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('level', 2)
    ->addAttributeToSelect('is_active', 1)
    ->setLoadProductCount(true);

foreach ($categories as $category) {
    echo $category->getProductCount();
} 

Try this one:

$categories = Mage::getModel('catalog/category')->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('level', 2) ->addAttributeToSelect('is_active', 1) ->setLoadProductCount(true); foreach ($categories as $category) { echo $category->getProductCount(); }$

Try this one:

    $categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('level', 2)
    ->addAttributeToSelect('is_active', 1)
    ->setLoadProductCount(true);

foreach ($categories as $category) {
    echo $category->getProductCount();
} 
1
source | link

Try this one:

$categories = Mage::getModel('catalog/category')->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('level', 2) ->addAttributeToSelect('is_active', 1) ->setLoadProductCount(true); foreach ($categories as $category) { echo $category->getProductCount(); }$