View Single Post
  #5  
Old 08-18-2007, 09:05 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: random.php/random product listing modification needed...

On 4.1.8 the category information and the product information are seperated, and then connected with a join table called xcart_products_categories, so you have to add this table to the query and then tell the query not to show products in categoryid 274.

Try this:

Code:
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing],$sql_tbl[products_categories] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid AND $sql_tbl[products_categories].productid=$sql_tbl[products].productid AND $sql_tbl[products_categories].categoryid!='274' ORDER BY RAND() LIMIT 4;";
Reply With Quote