I've done something similar on my site and have taken it a bit further. What I've done is if there are no best sellers available for that category, then I select the overall store bestsellers. That way your store look is uniform no matter what page you're on.
Just add this to modules/Bestsellers/bestsellers.php:
Code:
# BCSE
if(empty($bestsellers))
{
$threshold = 0;
$search_query = "$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"];
$bestsellers = func_search_products($search_query, !empty($user_account['membership'])?$user_account['membership']:"");
}
# BCSE
Before:
Code:
$smarty->assign("bestsellers",$bestsellers);
I did this for 3.5.x
Carrie