Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Big Images and Lightbox Problem


Recommended Posts

hoping one of you crafty guys out there could help,

I'm trying to use a slick java script to display my images on my osCommerce site. The problem that I am using a php file to pull up an image to display which, what I believe is messing up the java script.


This is what I mean in relation to my website:


This is the product info page that I'm trying to get the script to work on:




When you hit "click to enlarge" the lightbox java script starts but can't pull up the image.


Here's a bit of the code that pulls up the right picture:


if (tep_not_null($product_info['products_image'])) {
	  <table border="0" cellspacing="0" cellpadding="2" align="right">
		  <td align="center" class="smallText">

<script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '" target="_parent" rel="lightbox" title="'.$product_info['products_name'].'" >' . 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>'; ?>');
<?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>'; ?>


Here's the popup_image.php code

 $Id: popup_image.php,v 1.16 2003/02/13 03:10:56 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License



 $products_query = tep_db_query("select pd.products_name, p.products_image, p.products_bimage from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . $HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . $languages_id . "'");
 $products_values = tep_db_fetch_array($products_query);
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<title><?php echo $products_values['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">


if ($products_values['products_bimage'] == '') {
echo tep_image(DIR_WS_IMAGES . $products_values['products_image'], $products_values['products_name']);
} else {
echo tep_image(DIR_WS_IMAGES . $products_values['products_bimage'], $products_values['products_name']);


I have two images loaded, one small for the thumbnail and the a larger one that the popup_image.php pulls up.


Any ideas why it's not working? Could it be that the javascript wants an actual jpg file and not something like this: http://lifesessions.com/cart/popup_image.php?pID=33


Is way to incorporate the popup_image.php info into the product_info.php file?


Thank you for reading and ant advice offered



Link to comment
Share on other sites

  • 2 weeks later...



This is a good question. I'm also wondering how to change the code of lightbox to upload .jpg in popup file? I already have Small gifs as thumbnails and large ones for popup window. Is there someone who did, or knows how to incorporate lightbox in such a case?



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...