Magento 限制新产品块中显示的产品数量 [英] Magento limit the number of products shown with in the new products block

查看:26
本文介绍了Magento 限制新产品块中显示的产品数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何限制新产品区块中显示的产品数量?通过 cms/pages/design/Layout 更新 XML

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 不起作用,也不起作用

setLimit does not work, nor does

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

或:

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

或:

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

或:

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

或:

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

推荐答案

尝试

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

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

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;
}

阅读更多@http://www.magentocommerce.com/wiki/groups/248/display_products_on_home_page

这篇关于Magento 限制新产品块中显示的产品数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆