3

I wish to replace the drop-down (position, name, price) on the catalog page by simple links.

www\app\design\frontend\base\default\template\catalog\product\list\toolbar.html

2

Just change from

<div class="sort-by">
            <label><?php echo $this->__('Sort By') ?></label>
            <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 $this->__($_order) ?>
                </option>
            <?php endforeach; ?>
            </select>
            <?php if($this->getCurrentDirection() == 'desc'): ?>
                <a 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 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>

to

<div class="sort-by">
            <label><?php echo $this->__('Sort By') ?></label>
            <?php foreach($this->getAvailableOrders() as $_key=>$_order): ?>

                <a href="<?php echo $this->getOrderUrl($_key, 'asc') ?>" > <?php echo $this->__($_order) ?> ASC</a>
                <a href="<?php echo $this->getOrderUrl($_key, 'desc') ?>" > <?php echo $this->__($_order) ?>DESC</a>

            <?php endforeach; ?>

        </div>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.