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