Contributions
Thumbnail Category Browse
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.
Screenshots in package.
Super easy install: upload 2 new files and add 1 line of code to product_info.php
Expand All / Collapse All
Tooltip is a rollover zoom image box, without popup html page.
Very easy to install.
Exemple: www.expodreams.com/gallery/product_info.php?products_id=395
Enjoy!
Included is the full package with the revised thumb_bar.php.
RE: thumb_bar_join.php
The wrong parameter is being used for the call to tep_get_tax_rate().
Find this code:
[code]
# define the column select list
$column_list = 'p2c.products_id, p2c.categories_id, p.products_image, p.products_price, p.products_ordered';
[/code]
and change it to this:
[code]
# define the column select list
$column_list = 'p2c.products_id, p2c.categories_id, p.products_image, p.products_price, p.products_tax_class_id, p.products_ordered';
[/code]
Next, find this code:
[code]
$currencies->display_price($tmp['products_price'], tep_get_tax_rate($tmp['products_id']))
[//code]
and change it to this:
[code]
$currencies->display_price($tmp['products_price'], tep_get_tax_rate($tmp['products_tax_class_id']))
[/code]
All done...
Thread: http://forums.oscommerce.com/index.php?showtopic=132394&st=40&p=602040&#entry602040
This is NOT a complete package but a fix only.
Download: tumb_bar_join.php(fix).zip contains same txt as in here.
PHP 5+ doesn't let you get away with as many goofs. Everyone should check and see if the $page_number variable is duplicated in union_split_page_results.php on line 34.
In catalog/includes/classes/union_split_page_results.php
On line 34,
class unionSplit{
var $query, $num_rows, $page_number, $number_of_pages, $page_name, $page_number;
NOTICE: $page_number is declared twice.
FIX: remove the duplicate $page_number variable
class unionSplit{
var $query, $num_rows, $page_number, $number_of_pages, $page_name;
Sorry guys screwed up the upload this is the correctly modified file.
Thanx Chemo for bringing this to us once more ...
The mod a bit below to exclude the current product from the Quick Browser result set is buggy. If you have only one product in a category you will get a TEP STOP error.
To avoid this you will need to wrap most of the code in a $num_rows = mysql_num_rows($products_id_query);
IF ($num_rows > 0 ) { ... } Condition.
I included a fully modified file.
Quick and simple fix :
In thumb_bar.php look for :
$info_box_contents[0][] = array('align' => 'center',
'params' => 'class="smallText" valign="top" width="'.$width.'%"',
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $tmp['products_id'] . ( isset($_GET['page']) && tep_not_null($_GET['page']) && is_numeric($_GET['page']) ? '&page=' . (int)$_GET['page'] : '') ) . ( isset($cPath) && tep_not_null($cPath) ? '&cPath='.$cPath : '' ) . '">' . tep_image(DIR_WS_IMAGES . $tmp['products_image'], '', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $tmp['products_id']) . '">' . $tmp['products_name'] . '</a>');
and replace by:
$info_box_contents[0][] = array('align' => 'center',
'params' => 'class="smallText" valign="top" width="'.$width.'%"',
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $tmp['products_id'] . ( isset($_GET['page']) && tep_not_null($_GET['page']) && is_numeric($_GET['page']) ? '&page=' . (int)$_GET['page'] : '') ) . ( isset($cPath) && tep_not_null($cPath) ? '&cPath='.$cPath : '' ) . '">' . tep_image(DIR_WS_IMAGES . $tmp['products_image'], $tmp['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $tmp['products_id']) . '">' . $tmp['products_name'] . '</a>');
I included a modified file (from version 1.2)
A few people, including me, were having a 1064 SQL error when viewing the product info page from select products by manufacturer.
The following error occurred:
"1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'BY products_ordered desc LIMIT 0, 5' at line 1
SELECT SQL_CALC_FOUND_ROWS BY products_ordered desc LIMIT 0, 5"
After viewing the forums, carrerarod solved the problem, at least for me. Apparently, the script looks for a category id, but when you search by manufacturer, no categeory id shows up. Here’s the fix:
Just before line 43 in thumb_bar.php add:
if ($current_category_id == 0) {
$cat_query = tep_db_query("select categories_id from " .TABLE_PRODUCTS_TO_CATEGORIES. " where products_id ='".$product_info['products_id']."'");
$cat = tep_db_fetch_array($cat_query);
$current_category_id = $cat['categories_id'];
}
Included is the full package with the revised thumb_bar.php.
This is a simple modification to the contribution to exclude the current product from being displayed in the thumb previews.
Replace thumb_bar.php with this or make this simple modification:
FIND:
# get the products in the current category
$prod_query = "SELECT products_id FROM ".TABLE_PRODUCTS_TO_CATEGORIES." WHERE categories_id='".$current_category_id."'";
REPLACE WITH:
# get the products in the current category
# $prod_query = "SELECT products_id FROM ".TABLE_PRODUCTS_TO_CATEGORIES." WHERE categories_id='".$current_category_id."'";
// MOD TO EXCLUDE CURRENT PRODUCT LISTING FROM QUERY
$prod_query = "SELECT products_id FROM ".TABLE_PRODUCTS_TO_CATEGORIES." WHERE categories_id='".$current_category_id."' AND products_id != '".$products_id."'";
This release adds an alternate file that is coded with stock osC API and uses the familiar JOIN command.
The alternate file should work out-of-the box on any store that is capable of running osC-MS2
Also, the UNION file (thumb_bar.php) has been updated to include the change below (nice find BTW).
Thus, if you have problems with the UNION or unionSplit class just use the alternate and it should work without problems.
Enjoy!
small change - added missing alt txt for listed images in thumb_bar.php
Complete package included!
For "upgraders" just replace line 94 in thumb_bar.php with this line:
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $tmp['products_id'] . ( isset($_GET['page']) && tep_not_null($_GET['page']) && is_numeric($_GET['page']) ? '&page=' . (int)$_GET['page'] : '') ) . '">' . tep_image(DIR_WS_IMAGES . $tmp['products_image'], $tmp['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $tmp['products_id']) . '">' . $tmp['products_name'] . '</a>');
P.S.
Nice work Chemo
Respect!
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.
Screenshots in package.
Super easy install: upload 2 new files and add 1 line of code to product_info.php
Note: Contributions are used at own risk.