osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Enhanced BestSeller box with admin

This is a discussion on Enhanced BestSeller box with admin within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; Fixed the problem that the constribution didn't work with mysql 5++, only with version 4 and lower.... You can see ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Welcome to osCMax Join osCMax Now! Download osCMax Here
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 01-15-2007, 05:01 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 11,486
Thanks: 83
Thanked 356 Times in 334 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Enhanced BestSeller box with admin

Fixed the problem that the constribution didn't work with mysql 5++, only with version 4 and lower....

You can see working constribution with MySQL 5.0.21 on www.artesanias.de/catalog
HF! :)

It was a Left Join Bug, look here: http://bugs.mysql.com/bug.php?id=13551

-------------------------
Manual Installation
-------------------------

Find in catalogincludesboxesbestseller2.php :

$bestseller_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price from (" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_SPECIALS . " s on (p.products_id = s.products_id) left join " . TABLE_BESTSELLER . " b on (p.products_id = b.products_id) and p.products_id = pd.products_id where p.products_status = '1' and b.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_BESTSELLER_PRODUCTS);
}
else {
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_BESTSELLER_PRODUCTS_CATEGORY , $cat_name));
$bestseller_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_BESTSELLER . " b on p.products_id = b.products_id and p.products_id = pd.products_id where p.products_status = '1' and b.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_BESTSELLER_PRODUCTS);

and replace with:

// left join bug
$bestseller_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price from (" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_SPECIALS . " s on (p.products_id = s.products_id) left join " . TABLE_BESTSELLER . " b on (p.products_id = b.products_id) and p.products_id = pd.products_id where p.products_status = '1' and b.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_BESTSELLER_PRODUCTS);
}
else {
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_BESTSELLER_PRODUCTS_CATEGORY , $cat_name));
$bestseller_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price from (" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_SPECIALS . " s on (p.products_id = s.products_id) left join " . TABLE_BESTSELLER . " b on (p.products_id = b.products_id) and p.products_id = pd.products_id where p.products_status = '1' and b.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_BESTSELLER_PRODUCTS);



--------------------------
Automatic installation:
--------------------------


replace the catalogincludesboxesbestseller2.php

(I used version from 24 Jul 2006 so if you got an other version of this php dont replace it and do it manually as described above)



File is attached. HF :)

More...
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Bestseller box on main page coeus osCommerce 2.2 Modification Help 1 08-17-2005 12:44 AM
Bestseller according to main category selected Anonymous osCMax v1.7 Discussion 0 06-16-2004 07:37 AM
Bestseller box not showing... artloftart osCommerce 2.2 Modification Help 1 04-13-2004 09:32 PM


All times are GMT -8. The time now is 05:42 PM.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax