Thread: sortby
View Single Post
  #2  
Old 08-12-2008, 06:22 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default Re: sortby

to create a sortby dropdown box

main/seach_sort_by.tpl :

Code:
{* $Id: search_sort_by.tpl,v 1.5.2.2 2007/03/01 10:42:12 max Exp $ *} {if $url eq '' && $navigation_script ne ''}{assign var="url" value=$navigation_script|replace:"&":"&"|cat:"&"}{elseif $url ne ''}{assign var="url" value=$url|amp}{/if} <select name="sort_field" onchange="MM_jumpMenu('parent',this,0)"> {foreach from=$sort_fields key=name item=field} <option {if $name eq $selected and $direction eq 0}SELECTED{/if} value="{$url}sort={$name}&sort_direction=0">{$field} (Ascending)</option> <option {if $name eq $selected and $direction eq 1}SELECTED{/if} value="{$url}sort={$name}&sort_direction=1">{$field} (Descending)</option> {/foreach} </select>


And add the following in the <head> section of customer/home.tpl :
Code:
{literal} <script> function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } </script> {/literal}

Example here :
http://www.cglass.co.uk/lever-door-handles-and-escutcheons-c-635.html
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote