Magento getProductCount() de la sous-catégorie

la getProductCount() dans le deuxième niveau de la catégorie echo count imprimer 0, j'essaie de manière différente, mais je diddn pas à comprendre comme mage obtenir de collection etc, je n'ai trouver aucune solution à cette question

  <?php
$_category  = $this->getCurrentCategory();
$collection = Mage::getModel('catalog/category')->getCategories($_category->entity_id);
$helper     = Mage::helper('catalog/category');
?>
  <?php foreach ($collection as $cat):?>

  <?php 
  $cur_category = Mage::getModel('catalog/category')->load($cat->getId());
  $_img = $cur_category->getThumbnailUrl();
  ?>
  <div class="grid_4">
<div class="mineContent_grid_4">

 <dl>
  <dt>
    <a href="<?php echo $helper->getCategoryUrl($cat);?>">
        <?php echo $cat->getName();?>
        <img src="<?php echo $_img?>" title="<?php echo $cat->getName();?>" width="173" height="208"/>
    </a>
  </dt>    
    <?php $childLevel2Category = Mage::getModel('catalog/category')->getCategories($cat->entity_id);
    ?>
    <dd>
        <ol>
          <?php foreach ($childLevel2Category as $catLevel2) { ?>
          <?php
           $cur_category2 = Mage::getModel('catalog/category')->load($cat->getId());
           $count = $cur_category2->getProductCount();
          ?>

          <li> <a href="<?php echo $helper->getCategoryUrl($catLevel2);?>"><?php echo $catLevel2->getName();?> <span>(<?php echo $count ?>)</span></a></li>
          <?php } ?>
        </ol>
    </dd>
    </dl>
</div>
</div>
  <?php endforeach;?>
InformationsquelleAutor Federico | 2012-02-14