Thumbnail Category Browse v1.1 for osCommerce-MS2

( * with thumb_bar_join.php * )

by Chemo

What does this contribution do?

This contribution places an easily browseable thumbnail row at the bottom of the product info page. This row contains all the products in the currently viewed category with the products sorted by the products_ordered field so can be used as a powerful and easy to use upsale feature. It has a smart memory so their place within the product thumbnails is remembered and makes for a user friendly browsing experience.

How does this contribution work?

This contribution uses a very efficient UNION query to generate the data and does not use a resource intensive JOIN. It eliminates the filesort and temporary table overhead which is common with stock osCommerce queries. Initial benchmarks put the query execution time at .0005 seconds (1/2 millisecond) on a store with ~2,000 products and ~160 in category.

REQUIREMENT: You must have MySQL >= 4.0 to use the UNION

Optionally, I have also included an alternate file called "thumb_bar_join.php" that uses the familiar JOIN so that this contribution will have more compatibility. It uses the stock osCommerce splitPageResults class that is used for all the split pagination (products, reports, etc).

If you don't have MySQL >= 4.0 use the thumb_bar_join.php file instead!

Screenshots

How do I install this contribution?

Upload 2 new files, modify 1 existing file, done. Install should take less than 3 minutes.

STEP 1 - Upload the included files

The files should be located in the upload directory of this contribution.

STEP 2 - Edit product_info.php

1(a) - Find this code:

1(a) - Replace with this code:

1(a)(1) - If you want to use the alternate file replace with this code:

STEP 3 - Configure basic parameters

Edit includes/modules/thumb_bar.php

Edit the configuration values appropriately. I included the text definition within the module to make for easier installation with less steps. If you want or need this to be multi-lingual move the TEXT_THUMB_BAR definition to each language file (i.e. - includes/languages/german.php).

MAX_THUMBS_ROW => the number of thumbnails to display on the row
MIN_THUMBS_ROW => the minimum number of products before the row will display
TEXT_THUMB_BAR => infobox heading text. See note above about multi-lingual stores

Notes

The union query is very easy on system resources when compared to the traditional join query used by osCommerce. Using my osC-Explain contribution I have verified performance. I highly recommend installing the osC-Explain contribution if you are interested in optimizing high volume, high traffic, or high load stores.

However, after the initial release there were a few people that could not use it since the UNION requires MySQL >= 4.0 As a result, I have coded a stock osCommerce API alternate file that can be used by those that do not satisfy the MySQL requirements or are having problems with the unionSplit class. The alternate file should work on any store that is capable of running osCommerce-MS2

Support

osCommerce is a community driven organization and as such the support base will fall entirely on the forum members. This contribution is geared toward developers and not store owners that cut-n-paste contributions.

If you use this contribution and find it useful a small donation can be made via PayPal. This will enable me to offer one-on-one support and also fund releasing other contributions. In addition, if you make a donation it'll make you eligible for other performance optimization contributions that are not released!

After all the contributions I've coded and released I'm beginning to think nobody reads this far down...

Enter Donation amount: $

Credits

By me. Enjoy!




eCommerce-Directory.org

If you're interested in SEO for your store be sure to submit your site to my directory! It has a high PR and clean links






Blatant Footer Advertisement

If you need reliable, extremely fast, and expert webhosting for your store I am opening my server to accounts.  Each account gets unlimited everything and trust my server is setup to run osCommerce at top speed.

osCommerce Hosting and Technical Support - by Chemo