找到这个文件: app/code/core/Mage/Catalog/Block/Product/List/toolbar.php
直接vi(编辑)一下
注意到里面有一个protected 的属性:_direction,初始值为asc 也就是升序,我们把它改为desc!
magento1.5的改法是修改“public function getAvailableOrders”这方法,原先是
public function getAvailableOrders()
{
return $this->_availableOrder;
}
我把它调整为
public function getAvailableOrders()
{
/* at 21:36 2011/8/14 by chen@sjolzy.cn */
$this->_availableOrder = array(
// 'popularity' => Mage::helper('catalog')->__('Popularity'),
// 'entity_id' => Mage::helper('catalog')->__('Newest'),
'price' => Mage::helper('catalog')->__('Price'),
'name' => Mage::helper('catalog')->__('Name'),
'rating_summary' => Mage::helper('catalog')->__('Rating')
);
return $this->_availableOrder;
}
就保留按价格、名城、评分排序。