Showing posts with label High to Low. Show all posts
Showing posts with label High to Low. Show all posts

Friday 10 July 2015

Sort By Price: Low to High and High to Low in Magento

To Make this change please navigate through -> /app/design/frontend/default/your-theme/template/catalog/product/list/toolbar.phtml file.
Find

<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"
<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__($_order) ?>
</option>
 
and Replace with

<?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; ?>