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

前端 未结 2 1179
时光取名叫无心
时光取名叫无心 2021-01-13 13:37

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



        
相关标签:
2条回答
  • 2021-01-13 14:09

    Try

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

    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

    0 讨论(0)
  • 2021-01-13 14:21

    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)
    
    0 讨论(0)
提交回复
热议问题