title: how to set number of products to be displayed on home page in Magento
body: <p>I have a new.phtml file and new.php file, I'm sure that products display on home page is      coming from these files only. Currently there is only 6 products are being display. I just want to know how I can be able to display more products(should be incremented in multiplication of 3) like 9,12,15 etc.
  I tried to replace all '6' to '9' in both the files but I could not get what I'm looking for ? please please anyone help me and give me some tricks !
      Here is new.php file code:</p>
  
  <pre><code>class Mage_Catalog_Block_Pro duct_New extends Mage_Catalog_Block_Product_Abstract
  {
  protected $_productsCount = null;
  
  const DEFAULT_PRODUCTS_COUNT = 5;
  
  /**
   * Initialize block's cache
   */
  protected function _construct()
  {
      parent::_construct();
  
      $this-&gt;addColumnCountLayoutDepend('empty', 10)
          -&gt;addColumnCountLayoutDepend('one_column', 5)
          -&gt;addColumnCountLayoutDepend('two_columns_left', 4)
          -&gt;addColumnCountLayoutDepend('two_columns_right', 4)
          -&gt;addColumnCountLayoutDepend('three_columns', 3);
  
      $this-&gt;addData(array(
          'cache_lifetime'    =&gt; 86400,
          'cache_tags'        =&gt; array(Mage_Catalog_Model_Product::CACHE_TAG),
      ));
  }
  
  /**
   * Get Key pieces for caching block content
   *
   * @return array
   */
  public function getCacheKeyInfo()
  {
      return array(
         'CATALOG_PRODUCT_NEW',
         Mage::app()-&gt;getStore()-&gt;getId(),
         Mage::getDesign()-&gt;getPackageName(),
         Mage::getDesign()-&gt;getTheme('template'),
         Mage::getSingleton('customer/session')-&gt;getCustomerGroupId(),
         'template' =&gt; $this-&gt;getTemplate(),
         $this-&gt;getProductsCount()
      );
  }
  
  /**
   * Prepare collection with new products and applied page limits.
   *
   * return Mage_Catalog_Block_Product_New
   */
  protected function _beforeToHtml()
  {
      $todayStartOfDayDate  = Mage::app()-&gt;getLocale()-&gt;date()
          -&gt;setTime('00:00:00')
          -&gt;toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
  
      $todayEndOfDayDate  = Mage::app()-&gt;getLocale()-&gt;date()
          -&gt;setTime('23:59:59')
          -&gt;toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
  
      $collection = Mage::getResourceModel('catalog/product_collection');
      $collection-&gt;setVisibility(Mage::getSingleton('catalog/product_visibility')-&gt;getVisibleInCatalogIds());
  
  
      $collection = $this-&gt;_addProductAttributesAndPrices($collection)
          -&gt;addStoreFilter()
          -&gt;addAttributeToFilter('news_from_date', array('or'=&gt; array(
              0 =&gt; array('date' =&gt; true, 'to' =&gt; $todayEndOfDayDate),
              1 =&gt; array('is' =&gt; new Zend_Db_Expr('null')))
          ), 'left')
          -&gt;addAttributeToFilter('news_to_date', array('or'=&gt; array(
              0 =&gt; array('date' =&gt; true, 'from' =&gt; $todayStartOfDayDate),
              1 =&gt; array('is' =&gt; new Zend_Db_Expr('null')))
          ), 'left')
          -&gt;addAttributeToFilter(
              array(
                  array('attribute' =&gt; 'news_from_date', 'is'=&gt;new Zend_Db_Expr('not null')),
                  array('attribute' =&gt; 'news_to_date', 'is'=&gt;new Zend_Db_Expr('not null'))
                  )
            )
          -&gt;addAttributeToSort('news_from_date', 'desc')
          -&gt;setPageSize(9)
          -&gt;setCurPage(1)
      ;
  
      $this-&gt;setProductCollection($collection);
  
      return parent::_beforeToHtml();
  }
  
  /**
   * Set how much product should be displayed at once.
   *
   * @param $count
   * @return Mage_Catalog_Block_Product_New
   */
  public function setProductsCount($count)
  {
      $this-&gt;_productsCount = $count;
      return $this;
  }
  
  /**
   * Get how much products should be displayed at once.
   *
   * @return int
   */
  public function getProductsCount()
  {
      if (null === $this-&gt;_productsCount) {
          $this-&gt;_productsCount = self::DEFAULT_PRODUCTS_COUNT;
      }
      return $this-&gt;_productsCount;
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code> Here is my new.phtml file:
  
   &lt;?php $_helper = $this-&gt;helper('catalog/output'); ?&gt;
   &lt;?php if (($_products = $this-&gt;getProductCollection()) &amp;&amp; $_products-&gt;getSize()): ?&gt;
   &lt;?php $_columnCount = 3 ?&gt;
   &lt;div class="block-new-top"&gt;&lt;strong class="cat-tit"&gt;&lt;?php echo $this-&gt;__('New  Products') ?&gt;&lt;/strong&gt;&lt;/div&gt;
      &lt;div class="block-new"&gt;
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;div class="block-content"&gt;
      &lt;?php $m=1; ?&gt; 
      &lt;?php $i=0; foreach ($_products-&gt;getItems() as $_product): ?&gt;
          &lt;?php if ($i++%$_columnCount==0  ): ?&gt;
              &lt;ul class="products-grid" id="proid&lt;?php echo $m; ?&gt;"&gt;
                 &lt;?php endif ;?&gt;
              &lt;li class="item&lt;?php if(($i-1)%$_columnCount==0): ?&gt; first&lt;?php elseif($i%$_columnCount==0): ?&gt; last&lt;?php endif; ?&gt;"&gt;
                  &lt;a href="&lt;?php echo $_product-&gt;getProductUrl() ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;" class="product-image"&gt;&lt;img src="&lt;?php echo $this-&gt;helper('catalog/image')-&gt;init($_product, 'small_image')-&gt;resize(160) ?&gt;" width="160" height="160" alt="&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;" /&gt;&lt;/a&gt;
                  &lt;div class="align-prodname-price-review"&gt;
                          &lt;h3 class="product-name"&gt;&lt;a href="&lt;?php echo $_product-&gt;getProductUrl() ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;"&gt;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&lt;/a&gt;&lt;/h3&gt;
  
                          &lt;?php echo $this-&gt;getReviewsSummaryHtml($_product, 'short') ?&gt;
                   &lt;/div&gt;
  
                  &lt;div class="new-des"&gt;
  
                  &lt;?php
  
                                  $position=50; // Define how many character you want to display.
  
                                  $message= $_helper-&gt;productAttribute($_product, $_product-&gt;getShortDescription(), 'short_description'); 
                                  $post = substr($message, 0, $position); 
  
                                  echo $post;
                                  echo "..."; 
  
                                  ?&gt;
  
  
                  &lt;/div&gt;
  
                  &lt;div class="actions"&gt;
                  &lt;div class="pri"&gt;&lt;?php echo $this-&gt;getPriceHtml($_product, true, '-new') ?&gt;&lt;/div&gt;
                  &lt;div class="view-more"&gt;
                      &lt;?php if($_product-&gt;isSaleable()): ?&gt;
                          &lt;div class="detail-container"&gt;&lt;a href="&lt;?php echo $_product-&gt;getProductUrl() ?&gt;"&gt; View More&gt;&gt; &lt;/a&gt;&lt;/div&gt;
                      &lt;?php else: ?&gt;
                          &lt;p class="availability out-of-stock"&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Out of stock') ?&gt;&lt;/span&gt;&lt;/p&gt;
                      &lt;?php endif; ?&gt;
                  &lt;/div&gt;
  
                  &lt;/div&gt;
              &lt;/li&gt;
          &lt;?php if ($i%$_columnCount==0 || $i==count($_products)): ?&gt;
            &lt;/ul&gt;
          &lt;?php endif ?&gt;
          &lt;?php $m++; ?&gt;
      &lt;?php endforeach; ?&gt;
   &lt;/div&gt;
  &lt;?php endif; ?&gt;
   &lt;/div&gt;
   &lt;div class="block-new-bottom"&gt;&lt;/div&gt;
  </code></pre>