( * with thumb_bar_join.php * )
by Chemo
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.
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!
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.
- includes/classes/union_split_page_results.php should be uploaded to your *catalog*/includes/classes directory
- includes/modules/thumb_bar.php should be uploaded to your *catalog*/includes/modules directory
- OPTIONAL: includes/modules/thumb_bar_join.php should be uploaded to your *catalog*/includes/modules directory
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
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
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...
By me. Enjoy!
eCommerce-Directory.orgIf 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 AdvertisementIf 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. |