I'm new in magento. I'm wondering how I can count all products using stock quantity. For example, I have
- category 1
- product one - stock 10
- product two - stock 5
- category 2
- product three - stock 10
The result of the sum of all products should be 25
Actually, I'm using
<?php
$prods = Mage::getModel('catalog/product')->getCollection();
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($prods);
$count = number_format(count($prods));
echo $count;
?>
but this counts the products without stock quantity.
Thanks for your help.