Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I set item limit for New products and Recently viewed products? 
 
TravelSize_ie
Member
 
Total Posts:  39
Joined:  2009-10-19
 

How can I limit the number of products displayed on the homepage in the“Recently Viewed” section?

I’ve been editing the Layout Update XML in the Home Page CMS.
Just as I was posting, I worked out that for New products, I need to add a setProductsCount action when defining the block

<block type=“catalog/product_new” name=“home.catalog.product.new” alias=“product_new” template=“catalog/product/new.phtml” after=“cms_page”>
<
action method=“addPriceBlockType”><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
<
action method="setProductsCount"><count>3</count></action></block>

but I can’t work out what I need to set for Recent products? I’ve been through \app\code\core\Mage\Reports\Block\Product\Viewed.php, \app\code\core\Mage\Reports\Block\Product\Abstract.php and \app\code\core\Mage\Catalog\Block\Product\Abstract.php but I can’t find any relevant “set” function.

I’m starting to think I’m going to have to take a copy of the template ( \template\reports\home_product_viewed.phtml) and edit it, but obviously I’d prefer to do it when defining the block - is there an appropriate set function that I’ve missed that I can include in the definition?

<block type=“reports/product_viewed” name=“home.reports.product.viewed” alias=“product_viewed” template=“reports/home_product_viewed.phtml” after=“product_new”><action method=“addPriceBlockType”><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action></block>
 
Magento Community Magento Community
Magento Community
Magento Community
 
TravelSize_ie
Member
 
Total Posts:  39
Joined:  2009-10-19
 

Ah, I found it. It’s actually a configuration setting in the admin.

System -> Configuration, Under Catalog/Catalog > Recently Viewed/Compared Products.

There’s a “Default Recently Viewed Products Count” field and a “Default Recently Compared Products Count”.

“Default” would suggest there’s some other way of changing it, but I’m not sure what that is.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top