我正在使用magento ver。 1.9.2.3。我正在尝试在列表页面中添加价格下降排序。我该怎么做?。我试图通过添加下面的代码添加通过local.xml,但没有工作。任何帮助都是可以接受的....
with open('data.json', 'w') as f:
json.dump(data, f)
答案 0 :(得分:0)
转到/app/design/frontend/default/your-theme/template/catalog/product/list/toolbar.phtml 并找到
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__($_order) ?>
</option>
替换
<?php if ($_order != 'Price'): ?>
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__($_order) ?>
</option>
<?php else: ?>
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key) && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__($_order) . ': Low to High' ?>
</option>
<option value="<?php echo $this->getOrderUrl($_key, 'desc') ?>"<?php if($this->isOrderCurrent($_key) && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__($_order) . ': High to Low' ?>
</option>
<?php endif; ?>
不要忘记清除缓存