Currently I am making a custom RWD theme, with the Madison Island sample data. The category 'Women' contains 51 products in total. These products are divided in several different subcategories, for example 'Tops & Blouses'.
I looked around the internet for a piece of code that will help me display the amount of product within a category, and all answers came down to this code:
$categoryId = '4';
$products_count = Mage::getModel('catalog/category')->load($categoryId)->getProductCount();
echo $products_count;
Where 4 is the category ID of the category 'Women'. The problem is, is that this snippet echoes '3'. But I don't have 3 product, I have 51. Why is this?