当前位置 : 主页 > 网页制作 > xml >

xml – Magento限制新产品块中显示的产品数量

来源:互联网 收集:自由互联 发布时间:2021-06-13
如何限制新产品块中显示的产品数量? 通过cms / pages / design / Layout更新 XML block type="catalog/product_new" name="home.catalog.product.new" template="catalog/product/new.phtml" action method="setColumnCount"count5/cou
如何限制新产品块中显示的产品数量?
通过cms / pages / design / Layout更新 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不起作用,也不起作用

<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

/**
 * 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

网友评论