cancel
Showing results for 
Search instead for 
Did you mean: 

sorting by price (ascending - descending)in toolbar

sorting by price (ascending - descending)in toolbar

i need to add new tab in toolbar to sorting products by price and the drop down menu inside it (ascending - descending), i am used magento version 1.9.2

i need this code to added to toolbar.phtml file , after this code


<div class="sort-by">
<label><?php echo $this->__('Sort By') ?></label>
<select class="showPan" 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 $this->__($_order) ?>
</option>
<?php endforeach; ?>
</select>
<?php if($this->getCurrentDirection() == 'desc'): ?>
<a class="direction" rel="tooltip" data-placement="top" href="<?php echo $this->getOrderUrl(null, 'asc') ?>" title="<?php echo $this->__('Set Ascending Direction') ?>"><img src="<?php echo $this->getSkinUrl('images/i_desc_arrow.gif') ?>" alt="<?php echo $this->__('Set Ascending Direction') ?>" class="v-middle" /></a>
<?php else: ?>
<a class="direction" rel="tooltip" data-placement="top" href="<?php echo $this->getOrderUrl(null, 'desc') ?>" title="<?php echo $this->__('Set Descending Direction') ?>"><img src="<?php echo $this->getSkinUrl('images/i_asc_arrow.gif') ?>" alt="<?php echo $this->__('Set Descending Direction') ?>" class="v-middle" /></a>
<?php endif; ?>
</div>