Topmagento.com|Magento技术交流站

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

栏目:magento新手问题 , magento疑难解答      647 views      1 枚回复

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

1
2
3
4
5
6
7
< ?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.在此代码里面加入下面两行:

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

4.加完代码类似这样:

1
2
3
4
5
6
7
8
9
< ?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>

标签: ,

转载注明:转自Topmagento.com|Magento技术交流站

本站遵循:署名-非商业性使用-禁止演绎 3.0 共享协议

收藏分享: QQ书签 / 百度收藏 / Google书签 / 收藏到鲜果 / Digg / Del.icio.us


1 枚回复


  1. Rowdy 说道:

    What a joy to find such clear thinking. Thanks for psotnig!

    [回复]


发表回复


XHTML: 您可以使用如下代码:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>