For his functionality 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; ?>
Magento sort by special price (disounted product) on product list page dropdown (toolbar.phtml)
2 Comments
Mirza · April 29, 2016 at 10:02 pm
Perfect! Thanks.
deepak · December 21, 2016 at 11:57 am
I tried to put same code, It is getting displayed in drop down list, but sorting is not happening neither options are getting selected. I am using Magento ver. 2.1.2