title: Magento - Get list of all Manufacturers with product count
body: <p>I am using the following code to list all the manufacturers and it works like a charm:</p>
  
  <pre><code>$attribute = Mage::getModel('eav/entity_attribute')
                  -&gt;loadByCode('catalog_product', 'manufacturer');
  
  $valuesCollection = Mage::getResourceModel('eav/entity_attribute_option_collection')
              -&gt;setAttributeFilter($attribute-&gt;getData('attribute_id'))
              -&gt;setStoreFilter(0, false);
  
  $preparedManufacturers = array();            
  foreach($valuesCollection as $value) {
      $preparedManufacturers[$value-&gt;getOptionId()] = $value-&gt;getValue();
  }   
  
  
  if (count($preparedManufacturers)) {
      echo "&lt;h2&gt;Manufacturers&lt;/h2&gt;&lt;ul&gt;";
      foreach($preparedManufacturers as $optionId =&gt; $value) {
          echo "&lt;li&gt;" . $value . " - (" . $optionId . ")&lt;/li&gt;";
      }
      echo "&lt;/ul&gt;";
  }
  </code></pre>
  
  <p>What I am looking for is a way to display the number of products associated with each of the manufacturers. Can someone please tell me the way of doing this?</p>
  
  <p>Many thanks</p>