magento 分类页添加列表方式

默认只有两种方式grid,list,现在添加个test
1.app\code\core\Mage\Catalog\Block\Product\List\Toolbar.php

[php]
protected function _construct(){
...
    case 'grid-list':
    $this->_availableMode = array('grid' => $this->__('Grid'), 'list' =>  $this->__('List'), 'test' => $this->__('test'));
    break;
...
}

public function getAvailableLimit()
{
    $currentMode = $this->getCurrentMode();
    if (in_array($currentMode, array('list', 'grid', 'test'))) {
        return $this->_getAvailableLimit($currentMode);
    } else {
        return $this->_defaultAvailableLimit;
    }
}
[/php]

2.app\code\core\Mage\Catalog\etc\config.xml

[xml]
    <default>
        <catalog>
            <navigation>
                <max_depth>0</max_depth>
            </navigation>
            <frontend>
                <list_mode>grid-list</list_mode>
                <grid_per_page_values>9,15,30</grid_per_page_values>
                <list_per_page_values>5,10,15,20,25</list_per_page_values>
                <test_per_page_values>5,10,15,20,25</test_per_page_values>
[/xml]

你可能感兴趣的:(Magento)