Magento 默认显示全部 magento products per page on grid default value all

方法 1.  On an old thread I found the answer.

 

In admin go to System->Configuration->Catalog->Catalog->Frontend

 

Set List Mode to List Only or List as default and put a value of 0 for both Products per Page on List allowed values and Products per Page on List default value

 

from: http://www.magentocommerce.com/boards/viewthread/56910/

 

方法 2. Change this to make all products show all the time

app/code/core/Mage/Page/Block/Html/Pager.php:

 public function getLimit()
    {
        //always show all
        return 'all';
        $limits = $this->getAvailableLimit();
        if ($limit = $this->getRequest()->getParam($this->getLimitVarName())) {
            if (isset($limits[$limit])) {
                return $limit;
            }
        }
        $limits = array_keys($limits);
        return $limits[0];
    } 

 

I’m sure you can modify the above to meet your needs of only showing all products on certain pages, and defaulting to the normal behavior when you want it.  As you can see, this code does not use the database values, if there is nothing in the URL (getParams()) then it will use the first key of “$limits”.  $llimits is obtained from the code below.  If you only want certain pages to show all, you can probably override the above function in “Catalog/Block/Product/List/Toolbar.php”.  This will probably have the effect of only showing all for pagers that use the product list toolbar.  Changing the code in the above file will probably change *all* pages that show anything split into multiple pages.


To change the list of available options, change this:
app/code/core/Makge/Catalog/Block/Product/List/Toolbar.php

 public function getAvailableLimit()
    {
        if ($this->getCurrentMode() == 'list') {
            return array(5=>5,10=>10,15=>15,20=>20,25=>25, 'all'=>__('All'));
        }
        elseif ($this->getCurrentMode() == 'grid') {
            return array(9=>9,15=>15,30=>30, 'all'=>__('All'));
        }
        return parent::getAvailableLimit();
    } 

 

from: http://www.magentocommerce.com/boards/viewthread/2055/

 

 

 

你可能感兴趣的:(value)