Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Product Sort By - Dropdown

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-10-2008, 12:52 PM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Question 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
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #2  
Old 02-12-2008, 07:22 AM
  SpinyMan's Avatar 
SpinyMan SpinyMan is offline
 

Advanced Member
  
Join Date: Jan 2008
Posts: 30
 

Default Re: Product Sort By - Dropdown

Hi,
See the attached file.
This file originaly from "main/search_sort_by.tpl"
Attached Files
File Type: zip search_sort_by.zip (630 Bytes, 330 views)
__________________
Regards,
SpinyMan

X-Cart Templates Store -
http://www.x-cart-customization.com/shop/

X-Cart Customization Services -
http://www.x-cart-customization.com/
Reply With Quote
  #3  
Old 02-12-2008, 10:25 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default 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
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote

The following user thanks dalmuti for this useful post:
Aurora-S (05-02-2012)
  #4  
Old 02-12-2008, 04:39 PM
  DezineJunkie's Avatar 
DezineJunkie DezineJunkie is offline
 

Senior Member
  
Join Date: Jan 2008
Posts: 174
 

Default 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
__________________
X-CART Pro V.4.3.0
PHP version 5.2.11
MySQL version 5.0.81
Architecture x86_64
Apache version 2.2.14 (Unix)mod_ssl/2.2.14
Operating System: Linux
Dedicated Ip
cPanel Pro 1.0 (RC1)
cPanel Version 11.24.5-RELEASE
Modules: DL Expander, DL Products, One Page Checkout, Dynamic Images,
Multicolumn Recommends, Narrow by Search, Random Products Tabs.
X-AOM, SALES-N-STATS 1.3 , X-Offers-4.1.9, X-Magnifier41x, X-Fancy Categories,
X-RSS Feeds, Static Meta Tags , X-AJAX Rating System v4.1


Reply With Quote
  #5  
Old 02-12-2008, 04:42 PM
  DezineJunkie's Avatar 
DezineJunkie DezineJunkie is offline
 

Senior Member
  
Join Date: Jan 2008
Posts: 174
 

Question 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?
__________________
X-CART Pro V.4.3.0
PHP version 5.2.11
MySQL version 5.0.81
Architecture x86_64
Apache version 2.2.14 (Unix)mod_ssl/2.2.14
Operating System: Linux
Dedicated Ip
cPanel Pro 1.0 (RC1)
cPanel Version 11.24.5-RELEASE
Modules: DL Expander, DL Products, One Page Checkout, Dynamic Images,
Multicolumn Recommends, Narrow by Search, Random Products Tabs.
X-AOM, SALES-N-STATS 1.3 , X-Offers-4.1.9, X-Magnifier41x, X-Fancy Categories,
X-RSS Feeds, Static Meta Tags , X-AJAX Rating System v4.1


Reply With Quote
  #6  
Old 02-12-2008, 05:00 PM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default 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
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #7  
Old 04-01-2008, 01:25 PM
 
max2000 max2000 is offline
 

Member
  
Join Date: Mar 2008
Posts: 17
 

Default Re: Product Sort By - Dropdown

Hi SpinyMan

It works great!

Thanks.
__________________
Version 4.1.9
Reply With Quote
  #8  
Old 05-02-2008, 11:13 AM
 
ecommerce ecommerce is offline
 

eXpert
  
Join Date: Jul 2006
Posts: 267
 

Default 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?
__________________
X-Cart 4.0.18 DBest
Reply With Quote
  #9  
Old 03-11-2011, 09:45 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:34 AM.

   

 
X-Cart forums © 2001-2020