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)
    >?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:

Just set the number in tags.

No comments:

Post a Comment