View Single Post
  #9  
Old 08-28-2004, 05:45 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,066
 

Default

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote