X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   sortby (https://forum.x-cart.com/showthread.php?t=41690)

Vetrivel 08-12-2008 05:17 AM

sortby
 
i want to add another sort-by option and also want it to be displayed in a dropdown box along with the default option.
pls help me in doing it:-)




thanks in advance:-)

carlisleglass 08-12-2008 06:22 AM

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

balinor 08-13-2008 04:37 AM

Re: sortby
 
Please don't double post - I have removed your second post on this topic.

Vetrivel 08-13-2008 06:43 AM

Re: sortby
 
oops.. sorry.. i didnt get the answer yet......thats why...

balinor 08-13-2008 06:51 AM

Re: sortby
 
It doesn't matter if you got an answer or not - cross posting is not allowed :) One thread per question - if you don't get an answer, you can always open a ticket via your help desk.

Vetrivel 08-13-2008 08:08 PM

Re: sortby
 
i am really sorry.i will not repeat this in the future......


All times are GMT -8. The time now is 02:49 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.