Contributions

Features (Category Index)
Search: 

BestSellers Box Enhancement

******************************
BestSellers Box Enhancement
******************************


If you saw the CategoryBoxEnhancement contribution by Nils Petersson, you'd see where I came up with this one... This is a simple modification in the best_sellers.php box, to add a small line of code that'll allow an image to be displayed in front of the list of best sellers instead of that list 01, 02, 03, 04, etc.

Have fun with it!

******************************
Installation
******************************
Replace your file with this file, if you already have something in the best_sellers.php box, then simply make the added change..it's not difficult :)

Expand All / Collapse All

Bug fix (RC2) 4 Dec 2008

The random contrib was not working on my shop.

I changed the code to :

******************

$best_sellers_query = tep_db_query("SELECT *, RAND() AS rand_id FROM (select distinct p.products_id, p.products_image,pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_SELECT_BESTSELLERS.") AS a ORDER BY rand_id LIMIT " . MAX_DISPLAY_BESTSELLERS);
} else {
$best_sellers_query = tep_db_query("SELECT *, RAND() AS rand_id FROM (select distinct p.products_id, p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_SELECT_BESTSELLERS.") AS a ORDER BY rand_id LIMIT " . MAX_DISPLAY_BESTSELLERS);

}

******************

And now it works !! Instructions only. Download SQL query from previous contrib.

Bestsellers Enhancement plus Random display 23 Mar 2008
Updated to look a bit nicer 19 Mar 2008
Bestseller Box Enhancement v2.1 2 Nov 2007
Bestseller Box Enhancement v2 25 Oct 2007
BestSellers Box Enhancement Christina 19 Feb 2004

Note: Contributions are used at own risk.