Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

support thread for Lightbox v1.0 contribution


mwstinson

Recommended Posts

http://www.oscommerce.com/community/contributions,4383

 

Lightbox v1.0

Written 7-10-06

by Matthew Stinson

www.rcprivatelabel.com

 

############################################################

This contribution outlines implementation of Lightbox JS #

by Lokesh Dhakar. I take no credit for reating this cool #

tool. And only offer support on how to implement it with #

osCommerce. This is currently working on osc 2.2. you can #

see it in action at www.rcprivatelael.com #

#

############################################################

 

First upload the files that are included with this contrib to the root directory of your catalog.

Typically the catalog directory.

 

############################################################

 

Secondly you will at the following code between the <head> and </head> to any page that you want to use the script on.

Typically on catalog/product_info.php

 

<script type="text/javascript" src="lightbox.js"></script>

 

############################################################

 

thirdly if you want to use this contrib on the catalog/product_info.php page you will change

 

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>

 

 

with

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>

 

############################################################

 

to use this function on any other images you will Add rel="lightbox" attribute to any link tag to activate the lightbox.

For example: <a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>

Optional: Use the title attribute if you want to show a caption.

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

  • Replies 100
  • Created
  • Last Reply

Top Posters In This Topic

site url is not www.rcprivatelael.com

 

it is www.rcprivatelabel.com

Added lightbox 2.0 contrib

 

then I fugured something else out....

 

to put item description into the caption use the following on product_info.php

 

change:

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>

to:

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox" title="'?><?php echo $products_name; ?><?php '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

Does anyone know of a way for this to work if my large images are in a different directory? The large and small images have the same name but are in separate directories. Any help is appreciated. Thank you.

Link to comment
Share on other sites

On your site all i get on "the click to enlarge" is a pop up jpeg, as per usual i am using safari on a mac

 

I know that safari is pretty a restrictive browser, when it comes to benefitting from such great effects. I did some testing on my sisters Mac the other day, and found that an onclick event on a table row <tr> didnt even work. What a big shame. Had to change my site to make it 'navigate'able' for such users. Suppose you'll just have to make do with normal popups with a Mac, until the author or someone else can make a work around for this Safari bug :-(

Link to comment
Share on other sites

  • 1 month later...

Excellent contribution - thank you. I discovered it after playing with the same idea based on Lokesh Dhakar's lightbox, but I couldn't get it to work.

 

I have tried to use the up-dated code to display the product name under the lightbox image but it is causing the thumbnail to disappear from the product_info page.

 

Can you see something wrong in my code?

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox" title="'?><?php echo $products_name; ?><?php '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>

Link to comment
Share on other sites

  • 3 weeks later...
Excellent contribution - thank you. I discovered it after playing with the same idea based on Lokesh Dhakar's lightbox, but I couldn't get it to work.

 

I have tried to use the up-dated code to display the product name under the lightbox image but it is causing the thumbnail to disappear from the product_info page.

 

Can you see something wrong in my code?

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox" title="'?><?php echo $products_name; ?><?php '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>

 

I am having the same issue with the 2.0 release. I would like to add the caption - do not need multiple images, but the thumb on the product_info.php is not there with new code. Help please.

Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Link to comment
Share on other sites

I am having the same issue with the 2.0 release. I would like to add the caption - do not need multiple images, but the thumb on the product_info.php is not there with new code. Help please.

 

 

Here is what i have on my pages.

 

lines 27-35

 

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
<script type="text/javascript" src="lb2/js/prototype.js"></script>
<script type="text/javascript" src="lb2/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="lb2/js/lightbox.js"></script>
</head>

 

lines 111-114

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox" title="'?><?php echo $products_name; ?><?php '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>

 

I hope that this helps.

 

You can see the results of this code at: http://www.mwswebmaster.com/test/product_i...;products_id=32

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

I am pulling my hair out here. I have lightbox working fine until I add the code you suggested:

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox" title="'?><?php echo $products_name; ?><?php '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

 

THe only real difference is

title="'?><?php echo $products_name; ?><?php '">' .

 

When I insert that snipet the picture no longer appears on my product_info.php page, just the product Model. If I click on the model the lightbox window pos and now I have the title. Unfortunately without the product on the porduct page it is worthless. Any suggestions?

Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Link to comment
Share on other sites

post code for entile page.

I will take a look.

 

Thanks.

 

 

I am pulling my hair out here. I have lightbox working fine until I add the code you suggested:

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox" title="'?><?php echo $products_name; ?><?php '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

 

THe only real difference is

title="'?><?php echo $products_name; ?><?php '">' .

 

When I insert that snipet the picture no longer appears on my product_info.php page, just the product Model. If I click on the model the lightbox window pos and now I have the title. Unfortunately without the product on the porduct page it is worthless. Any suggestions?

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

post code for entile page.

I will take a look.

 

Thanks.

 

Here is the /catalog/product_infor.php for my site. I appreciate your taking the time to assist.

 

<?php

/*

$Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_check = tep_db_fetch_array($product_check_query);

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

<?php

// Begin Dynamic Meta Tag Code

if (file_exists(DIR_WS_INCLUDES . 'meta_tags.php'))

{

require(DIR_WS_INCLUDES . 'meta_tags.php');

}

// End Dynamic Meta Tag Code

?>

<script language="javascript"><!--

function popupWindow(url) {window.open(url,'popupWindow',& #39;toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')}

//--></script>

<script type="text/javascript" src="lb2/js/prototype.js"></script>

<script type="text/javascript" src="lb2/js/scriptaculous.js?load=effects"></script>

<script type="text/javascript" src="lb2/js/lightbox.js"></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="860" cellspacing="0" cellpadding="0" background="images/tableback.gif" align="center">

<tr>

<td width="535" valign="top" background="images/tableback.gif"><table border="0" width="535" cellspacing="0" cellpadding="0">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="535" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="500" cellspacing="0" cellpadding="0">

<?php

if ($product_check['total'] < 1) {

?>

<tr>

<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="535" cellspacing="1" cellpadding="0" class="contents" align="center">

<tr class="Contentbox">

<td><table border="0" width="535" cellspacing="0" cellpadding="0">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<?php

} else {

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_info = tep_db_fetch_array($product_info_query);

 

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

 

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

} else {

$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

}

 

if (tep_not_null($product_info['products_model'])) {

$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';

} else {

$products_name = $product_info['products_name'];

}

?>

<tr>

<td><table border="0" width="535" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main">

<?php

if (tep_not_null($product_info['products_name'])) {

?>

<table border="0" cellspacing="0" cellpadding="0" align="right">

<tr>

<td align="center" class="smallText">

 

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox" title="'?><?php echo $products_name; ?><?php '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

</td>

</tr>

</table>

<?php

}

?>

<p><?php echo stripslashes($product_info['products_description']); ?></p>

<?php

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

$products_attributes = tep_db_fetch_array($products_attributes_query);

if ($products_attributes['total'] > 0) {

?>

<table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main" colspan="0"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>

</tr>

<?php

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

$products_options_array = array();

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

 

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

?>

<tr>

<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>

<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

</tr>

<?php

}

?>

</table>

<?php

}

?>

</td>

 

<?php

// DANIEL: begin - show related products

$attributes = "select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from " . TABLE_PRODUCTS_OPTIONS_PRODUCTS . ", " . TABLE_PRODUCTS_DESCRIPTION . " pa, ". TABLE_PRODUCTS . " pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '" . (int)$languages_id . "' and pop_products_id_master = '".$HTTP_GET_VARS['products_id']."' and products_status=1 order by pop_order_id, pop_id";

$attribute_query = tep_db_query($attributes);

 

if (mysql_num_rows($attribute_query)>0) {

 

echo '<tr><td><table class="productlisting" border="0" cellspacing="0" cellpadding="0" width="100%">';

echo '<tr><td align="center" class="productListing-heading" > '.TEXT_RELATED_PRODUCTS.' </td></tr><tr><td align="center" class="productListing-data">';

echo '<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center"><Tr>';

 

while ($attributes_values = tep_db_fetch_array($attribute_query)) {

$products_name_slave = ($attributes_values['products_name']);

$products_id_slave = ($attributes_values['pop_products_id_slave']);

if ($new_price = tep_get_products_special_price($products_id_slave)) {

$products_price_slave = $currencies->display_price($new_price, tep_get_tax_rate($attributes_values['products_tax_class_id']));

} else {

$products_price_slave = $currencies->display_price($attributes_values['products_price'], tep_get_tax_rate($attributes_values['products_tax_class_id']));

}

 

// show thumb image if Enabled

echo '<td class="productListing-data" align="center">';

if (MODULE_RELATED_PRODUCTS_SHOW_THUMBS!='False') {

echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">' . tep_image(DIR_WS_IMAGES . $attributes_values['products_image'], $attributes_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"').'</a>';

}

echo '<Br> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">'.$products_name_slave.'<Br>@ '.$products_price_slave.'</a>';

}

echo '</td>';

 

echo '</tr></table></td></tr></table></td></tr>';

}

//DANIEL: end

?>

 

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

$reviews = tep_db_fetch_array($reviews_query);

if ($reviews['count'] > 0) {

?>

<tr>

<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

 

if (tep_not_null($product_info['products_url'])) {

?>

<tr>

<td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

 

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>

</tr>

<?php

} else {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="535" cellspacing="1" class="contents">

<tr class="Contentbox">

<td><table border="0" width="535" cellspacing="0" cellpadding="0">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td>

<?php

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

}

?>

</td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

<td width="138" valign="top"><table border="0" width="138" cellspacing="0" cellpadding="0" align="right">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

 

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Link to comment
Share on other sites

Really dont know what to say. It works on my site. no doubt about it. But it seems that you have the exact same code as I do. Hmmmmm. At a loss. Sorry. just wondering if you have all of the files where they are supposed to be. But it would seem that you do if the main part of the script works. I really dont know.

 

Sorry. <_<

 

Here is the /catalog/product_infor.php for my site. I appreciate your taking the time to assist.

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

OK, OK - I think that the problem is with the model #. I noticed that on my site I do not use model #s.

 

I changed the code a small bit. It seems to work better. Maybe someone else can make more progress with it.

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox[pro]" title="'.  $products_name.  '"><br>'. tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

OK I took your lead and modified the code to this:

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox" title="' . $products_name.' <br>'. tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

This allows it to work, the only issue I have is that the product ID number appears above the image of the thumbnail and is highlighted with the "CLICK TO ENLARGE" text. Any suggestions?

Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Link to comment
Share on other sites

Hello

 

I asked this in general but it really should have been here.

 

Can someone please help, sometime ago i installed the 3 images in product_info.php and it works fine, know i have installed the great lightbox contribution and this also works fine but only on the top image, i have tried to make it work with images 2 and 3 but everytime i mess around with it its not quite working.

 

Script for product image number two as below:

 

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link

(FILENAME_POPUP_IMAGE_2, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image

(DIR_WS_IMAGES . $product_info['products_image_2'], addslashes($product_info['products_name']),

SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' .

TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

//--></script>

<noscript>

 

And this is the lightbox script that i would like to make work with the above code:

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_2']) . '"

target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info

['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' .

TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

 

Sorry to be a pain...

 

Kind regards

 

David

Link to comment
Share on other sites

  • 3 weeks later...

I've implemented this contribution into my site and it working for the most part (meaning, when I click on any of my product images, the image is opened in the "lightbox" and enlarged as expected). I'm experiencing two issues that I can't figure out, though. One, on my home page, in my "What's New Here" section, the images are being set to their original size that I downloaded from my supplier and they are basically taking up the entire page (Not what I want). Two, the "Click to Enlarge" text is not showing up at all on any of the images. I would appreciate any guidance.

Link to comment
Share on other sites

  • 2 weeks later...

.. and 10 minutes later i found out that you just had to change some codes :)

For other people who would like to have both flash and lightbox change this:

 

<param name="wmode" value="transparent" />

<EMBED src="swf.swf" quality=best bgcolor=#FFFFFF wmode="transparent" WIDTH="550"

 

You can find the lines at the place you add the flash files at.

 

Thanks for a good looking contribution.

Link to comment
Share on other sites

  • 1 month later...

Will this work with more pics v 6 1.2b?

 

I have tried ajax lighbox but seem to have problems setting up where I want the images to appear.

Link to comment
Share on other sites

Will this work with more pics v 6 1.2b?

 

I have tried ajax lighbox but seem to have problems setting up where I want the images to appear.

 

It can be made to work but there will be alot of modifications that arent documented anywhere. If you are good it can be done.

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

Nice looking pop-up script, I have a question or issue with firefox 2.0 browser.

 

I've implemented the script as per the instructions but the pop-up show's up at the bottom of the page forcing someone to scroll down and they can only see part of the image with the close button above it.

 

Please have a look with the firefox browser and verify.

 

http://www.casa-beads.com/catalog/product_...;products_id=28

 

Also when I view the pop-up in IE 6 the transparent background does not cover the entire width of the browser window?

 

Is there anything that can be done to resolve these issues? Tried editing some of the style sheet code but no change.

Link to comment
Share on other sites

Nice looking pop-up script, I have a question or issue with firefox 2.0 browser.

 

I've implemented the script as per the instructions but the pop-up show's up at the bottom of the page forcing someone to scroll down and they can only see part of the image with the close button above it.

 

Please have a look with the firefox browser and verify.

 

http://www.casa-beads.com/catalog/product_...;products_id=28

 

Also when I view the pop-up in IE 6 the transparent background does not cover the entire width of the browser window?

 

Is there anything that can be done to resolve these issues? Tried editing some of the style sheet code but no change.

 

Turns out my firefox/lightbox display/placement issues must have been cached related. Cleared the cached and restarted Firefox and now the pop-up is displaying correctly for the pop-up's.

 

But IE is still having issues with the transparent background only taking up a portion of the screen width. See below. Is it something with the lightbox code or is it something with it interacting with my oscommerce site (stylesheet.css, etc...) ?

 

lightbox.jpg

 

Regards,

Ron

Link to comment
Share on other sites

Ron-

 

Try Removing the default margin and padding from the body tag. Add body{ margin: 0; padding: 0; } to your stylesheet.

Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...