Wednesday 9 November 2011

Magento: set number of products in new products

You can set number of products to be displayed in new product in your new.phtml file. Find:
 <?php $i=0; foreach ($_products->getItems() as $_product): ?>
and add above, so the code looks like this:
    <?php $_products->setOrder('news_from_date')->setPageSize(6)
  ->setCurPage(1);?>
    >?php $i=0; foreach ($_products->getItems() as $_product): ?>
Set the number (6) as you like. Or you can display all new product by $size = $_products->getSize(); set the number ($size). On the other hand you can set this number in administration on home cms page. Under Custom desing set the code for new products to look like this:

    
    8
    
    bundle
    bundle/catalog_product_price
    
    
    
    
Just set the number in tags.

No comments:

Post a Comment