szabob Posted November 4, 2010 Share Posted November 4, 2010 Can anyone help me in modifying the Sort by dropdown to links likeSort by: price-lowest first price- highest first name etc..I think the product-sort.tpl file should be modified but I don't know how.ThanksBob Link to comment Share on other sites More sharing options...
rocky Posted November 5, 2010 Share Posted November 5, 2010 Try changing lines 12-24 of product-sort.tpl from: <form id="productsSortForm" action="{$request}"> {l s='--'} {l s='price: lowest first'} {l s='price: highest first'} {l s='name: A to Z'} {l s='name: Z to A'} {l s='in-stock first'} {l s='sort by'} </form> to: {l s='sort by'} <a href="{$link->addSortDetails($request, 'position', $orderwayposition)|escape:'htmlall':'UTF-8'}">{l s='--'} <a href="{$link->addSortDetails($request, 'price', 'asc')|escape:'htmlall':'UTF-8'}">{l s='price: lowest first'} <a href="{$link->addSortDetails($request, 'price', 'desc')|escape:'htmlall':'UTF-8'}">{l s='price: highest first'} <a href="{$link->addSortDetails($request, 'name', 'asc')|escape:'htmlall':'UTF-8'}">{l s='name: A to Z'} <a href="{$link->addSortDetails($request, 'name', 'desc')|escape:'htmlall':'UTF-8'}">{l s='name: Z to A'} <a href="{$link->addSortDetails($request, 'quantity', 'desc')|escape:'htmlall':'UTF-8'}">{l s='in-stock first'} That should hopefully display them as links instead of a dropdown. I'm not sure how it will look though. Link to comment Share on other sites More sharing options...
szabob Posted November 5, 2010 Author Share Posted November 5, 2010 Great. Thanks for the fast reply! Link to comment Share on other sites More sharing options...
samuelprabhu Posted June 12, 2014 Share Posted June 12, 2014 Try changing lines 12-24 of product-sort.tpl from: <form id="productsSortForm" action="{$request}"> <p class="select"> <select id="selectPrductSort"> <option value="{$link->addSortDetails($request, 'position', $orderwayposition)|escape:'htmlall':'UTF-8'}" {if $orderby eq 'position'}selected="selected"{/if}>{l s='--'}</option> <option value="{$link->addSortDetails($request, 'price', 'asc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'price' AND $orderway eq 'ASC' }selected="selected"{/if}>{l s='price: lowest first'}</option> <option value="{$link->addSortDetails($request, 'price', 'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'price' AND $orderway eq 'DESC'}selected="selected"{/if}>{l s='price: highest first'}</option> <option value="{$link->addSortDetails($request, 'name', 'asc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'name' AND $orderway eq 'ASC' }selected="selected"{/if}>{l s='name: A to Z'}</option> <option value="{$link->addSortDetails($request, 'name', 'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'name' AND $orderway eq 'DESC'}selected="selected"{/if}>{l s='name: Z to A'}</option> <option value="{$link->addSortDetails($request, 'quantity', 'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'quantity' AND $orderway eq 'DESC' }selected="selected"{/if}>{l s='in-stock first'}</option> </select> <label for="selectPrductSort">{l s='sort by'}</label> </p></form> to: <p>{l s='sort by'}<a href="{$link->addSortDetails($request, 'position', $orderwayposition)|escape:'htmlall':'UTF-8'}">{l s='--'}</a><a href="{$link->addSortDetails($request, 'price', 'asc')|escape:'htmlall':'UTF-8'}">{l s='price: lowest first'}</a><a href="{$link->addSortDetails($request, 'price', 'desc')|escape:'htmlall':'UTF-8'}">{l s='price: highest first'}</a><a href="{$link->addSortDetails($request, 'name', 'asc')|escape:'htmlall':'UTF-8'}">{l s='name: A to Z'}</a><a href="{$link->addSortDetails($request, 'name', 'desc')|escape:'htmlall':'UTF-8'}">{l s='name: Z to A'}</a><a href="{$link->addSortDetails($request, 'quantity', 'desc')|escape:'htmlall':'UTF-8'}">{l s='in-stock first'}</a></p> That should hopefully display them as links instead of a dropdown. I'm not sure how it will look though. Thanks, Iinks working fine but issue i am facing is that total page gets reloaded and the selected filters gets cleared. Any suggestions to get rid of this issue. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now