The code I gave in this thread was written for 3.5.x So it looks like in 4.0.x you need to add an AND right after:
So that it looks like this now:
Code:
$search_query = "AND $sql_tbl[products].forsale='Y' and $sql_tbl[products].avail>0 and $sql_tbl[products].sales_stats > $threshold AND $sql_tbl[categories].avail='Y' and price>0 group by $sql_tbl[products].productid order by sales_stats DESC, views_stats DESC limit ".$config["Modules"]["number_of_bestsellers"];
I haven't tested this, so just let me know if it doesn't work.
Thanks!
Carrie