Organizational Research By

Surprising Reserch Topic

magento limit the number of products shown with in the new products block


magento limit the number of products shown with in the new products block  using -'xml,magento,limit,products'

How to limit the number of products shown with in the new products block?
via cms/pages/design/Layout update XML

<block type="catalog/product_new" name="home.catalog.product.new" template="catalog/product/new.phtml" >
   <action method="setColumnCount"><count>5</count></action>
   <action method="setLimit"><limit>5</limit></action>
</block>


setLimit does not work, nor does

<action method="setDefaultGridPerPage"><limit>5</limit></action>


or:

<action method="setData"><key>limit</key><value>3</value></action>


or:

<action method="setProductLimit"><count>5</count></action>


or:

<action method="setProductsLimit"><count>5</count></action>


or:

<action method="setProductsCount"><count>5</count></action>

    

asked Oct 11, 2015 by mcasudhir
0 votes
26 views



Related Hot Questions

2 Answers

0 votes

Don't try it randomly. You're trying to call an action on a block/product_new. So go into the class Mage_Catalog_Block_Product_Abstract and see what function could do the job (double Ctrl+O in eclipse)

Here i see a Mage_Catalog_Block_Product_Abstract::addColumnCountLayoutDepend($pageLayout, $columnCount) function.

Maybe it can help you. Example:

$this->addColumnCountLayoutDepend('one_column', 5)
answered Oct 11, 2015 by nikhilapatil
0 votes

Try

 5

See /app/code/core/Mage/Catalog/Block/Product/New.php

/**
 * Set how much product should be displayed at once.
 *
 * @param $count
 * @return Mage_Catalog_Block_Product_New
 */
public function setProductsCount($count)
{
    $this->_productsCount = $count;
    return $this;
}

Read more @ http://www.magentocommerce.com/wiki/groups/248/display_products_on_home_page

answered Oct 11, 2015 by girisha

...