View Single Post
  #5  
Old 11-18-2010, 11:36 AM
 
shorelineoftahoe shorelineoftahoe is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 30
 

Default Re: Sort by manufacturer

Here's updated instructions for 4.4:

1) Find these lines right near the top of the file:

$sort_fields = array(
'productcode' => 'lbl_sku',
'title' => 'lbl_product',
'price' => 'lbl_price',
'orderby' => 'lbl_default',
);

And right below that add:

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


2) At around line 905 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