View Single Post
  #1  
Old 05-10-2010, 12:12 PM
 
shorelineoftahoe shorelineoftahoe is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 30
 

Default Sort by manufacturer

I've done this in 4.3, but it should be similar in older versions:

in include/search.php make the following changes:



1) Find these lines right near the top of the file:
"orderby" => func_get_langvar_by_name("lbl_default")
);

And right below that add:

# sort by manufacturer mod begins
if(!$manufacturerid)
$sort_fields["manufacturer"] = func_get_langvar_by_name("lbl_manufacturer"); #sort by manuf mod
# sort by manufacturer mod ends


2) At around line 630 there's a switch case. Right before these lines:

default:
$sort_string = "$sql_tbl[products].product";

Add:

# sort by manufacturer mod begins
case "manufacturer":
$left_joins['manufacturers'] = array(
"on" => "$sql_tbl[manufacturers].manufacturerid = $sql_tbl[products].manufacturerid"
);
$sort_string = "$sql_tbl[manufacturers].manufacturer $direction";
break;
# sort by manufacturer mod ends

3) Make sure to run WWW.YOURSITE.com/cleanup.php
That's it!
__________________
xcart v. 4.18-4.4
Reply With Quote