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)
-   -   Product Sort By - Dropdown (https://forum.x-cart.com/showthread.php?t=37481)

dalmuti 02-10-2008 12:52 PM

Product Sort By - Dropdown
 
Has anyone created or know of a forum thread that explains how to modify the code to change the sort by on the products page to a dropdown selection?

Looking for a solution for the 4.1.x branch.

Thanks,

Louise

SpinyMan 02-12-2008 07:22 AM

Re: Product Sort By - Dropdown
 
1 Attachment(s)
Hi,
See the attached file.
This file originaly from "main/search_sort_by.tpl"

dalmuti 02-12-2008 10:25 AM

Re: Product Sort By - Dropdown
 
SpinyMan,

Excellent! That was what I was looking for.

Below is a slightly different version. Both are useful.

Quote:

<table>
<tr>
<td>
{$lng.lbl_sort_by}:
<select name="sort_by" ONCHANGE="location = this.options[this.selectedIndex].value;" >
{foreach from=$sort_fields key=name item=field}
{if $navigation_page > 1}{assign var="cur_url" value=$url|cat:"page="|cat:$navigation_page|cat:"& amp;sort="|cat:$name|cat:"&amp;sort_direction="}
{else}{assign var="cur_url" value=$url|cat:"sort="|cat:$name|cat:"&amp;sort_di rection="}
{/if}
<option value="{$cur_url}1" {if $name eq $selected && $direction eq 1}selected="selected"{/if}>{$field} (UP)</option>
<option value="{$cur_url}0" {if $name eq $selected && $direction eq 0}selected="selected"{/if}>{$field} (Down)</option>
{/foreach}
</select>
</td>
</tr>
</table>


Thank you! I am sure others will find these useful as well.

Louise

DezineJunkie 02-12-2008 04:39 PM

Re: Product Sort By - Dropdown
 
Quote:

Originally Posted by SpinyMan
Hi,
See the attached file.
This file originaly from "main/search_sort_by.tpl"


Hey spiny guy- i opened the zip and got stickies! huh!
what is the code for that- for dropdown

DezineJunkie 02-12-2008 04:42 PM

Re: Product Sort By - Dropdown
 
Quote:

Originally Posted by dalmuti
SpinyMan,

Excellent! That was what I was looking for.

Below is a slightly different version. Both are useful.



Thank you! I am sure others will find these useful as well.

Louise


hi louise
what temp does this go in the product.tpl?

dalmuti 02-12-2008 05:00 PM

Re: Product Sort By - Dropdown
 
main/search_sort_by.tpl - just replace or comment out the default code

It doesn't go on the product.tpl


Louise

max2000 04-01-2008 01:25 PM

Re: Product Sort By - Dropdown
 
Hi SpinyMan

It works great! :-)

Thanks.

ecommerce 05-02-2008 11:13 AM

Re: Product Sort By - Dropdown
 
I'm wondering how the dropdown looked/came out.
Any of you got it live to see how it worked out?

ADDISON 03-11-2011 09:45 AM

Re: Product Sort By - Dropdown
 
Louise your idea is OK, but the code is not. Could you please revise it?

Victor your custom work is working great. I appreciate if you offer it as only one select menu, without pushing any button after selecting. Close to Louise (which is not working).

Thanks.

Quote:

Originally Posted by dalmuti
SpinyMan,

Excellent! That was what I was looking for.

Below is a slightly different version. Both are useful.



Thank you! I am sure others will find these useful as well.

Louise



All times are GMT -8. The time now is 03:27 AM.

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