Jump to content

Sort by from dropdown to buttons


wondrik

Recommended Posts

Need to change file:

themes/default/product-sort.tpl

 

Tried a little but is not that easy. css change is not that obvious...

 

As a first idea, you should change the list to radio buttons. Something like this:

<option value="price:asc" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Price: Lowest first'}</option>

 

you could change into

 

<input type="radio" name="selectPrductSort" value="price:asc" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='$$, Low-High'}

 

Well, lot off puzzling, but maybe gives some initial idea.

My 2 cents,

pascal

Link to comment
Share on other sites

  • 1 month later...

It's rather simple. I just done this but in presta 1.4.10

 

I guess it will be same logic:

 

               <ul>
                 <li>Sort by:</li>
                   <li><a href="{$request|escape:'htmlall':'UTF-8'}&orderby=name&orderway=asc">Name ▲</a></li>
                   <li><a href="{$request|escape:'htmlall':'UTF-8'}&orderby=name&orderway=desc">Name ▼</a></li>
                   <li><a href="{$request|escape:'htmlall':'UTF-8'}&orderby=price&orderway=asc">Price ▲</a></li>
                   <li><a href="{$request|escape:'htmlall':'UTF-8'}&orderby=price&orderway=desc">Price ▼</a></li>    
               </ul>

 

I use $request variable which returns actual url of category (it was there already used for standard sortking from list).

 

Hope this helps.

Link to comment
Share on other sites

  • 3 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...