移除magento里list排列“Position”属性选项

来源:互联网 发布:程序员怎么去找视频 编辑:程序博客网 时间:2024/05/26 22:59

1.打开编辑 app/design/frontend/default/Yourtheme/template/catalog/product/list/toolbar.phtml
2.找到类似下面代码

 

< ?php echo$this->__('Sort by')?><select onchange="setLocation(this.value)">< ?php foreach($this->getAvailableOrders()as$_key=>$_order):?><option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"< ?php if($this->isOrderCurrent($_key)):?> selected="selected"< ?php endif;?>>< ?php echo$_order?></option>< ?php endforeach;?></select>

 

3.在此代码里面加入下面两行:

< ?php if($_order!='Position'):// Remove "Position" from the sort option list ?>//code< ?php endif;// End for removing "Position" sort option ?>

4.加完代码类似这样

< ?php echo$this->__('Sort by')?><select onchange="setLocation(this.value)">< ?php foreach($this->getAvailableOrders()as$_key=>$_order):?>< ?php if($_order!='Position'):// Remove "Position" from the sort option list ?><option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"< ?php if($this->isOrderCurrent($_key)):?> selected="selected"< ?php endif;?>>< ?php echo$_order?></option>< ?php endif;// End for removing "Position" sort option ?>< ?php endforeach;?></select>


原创粉丝点击