Jump to content
Sign in to follow this  
tractormad

Support Thread For Fancy Lightbox Popup Contribution

Recommended Posts

Hello,

 

I just installed this contribution which is great, but there is a problem :

 

The image called close.gif doesn't appear on the box in order to close it. Then, when I click on the broken image, a vertical srollbar appears and it doesn't close the popup. I must click one time again in order to close it...

 

What's up ? :blink:

 

Thank you...

I am haveing the same problem. I have looked at line 327 and I do not see how you did this? could you paste your code?

Thanks

Share this post


Link to post
Share on other sites

Ok, never mind I have the lightbox working now! THanks for this sweeeeeet contribution! Love it! :D

Share this post


Link to post
Share on other sites

I installed the Additional Images contribution and got it to work on extra images with the lightbox by grouping them in product_info.php and additional_images.php. One thing though: I can't get the prev.gif and next.gif to appear in the lightbox. They are active because the right and left side are clickable and you can move trough the set of images in the product description. So the path seems to be correct; I've copied them to my image directory in catalog. Even after I've set the images to be visible all the time (not on hover only) they don't show up. Close.gif is there though. Anypne know what's causing this? Couldn't find the solution on the Lightbox message board on huddletogheter.com either, although it was adressed in 1 topic....

Share this post


Link to post
Share on other sites

I just want to add that it's not due to the browser using 2 stylesheets (lightbox.css and stylesheet.css), I've just merged the two into 1, only using stylesheet.css. Lightbox still active and working properly on the set of images but still no prev.gif or next.gif...

Share this post


Link to post
Share on other sites
I installed the Additional Images contribution and got it to work on extra images with the lightbox by grouping them in product_info.php and additional_images.php. One thing though: I can't get the prev.gif and next.gif to appear in the lightbox. They are active because the right and left side are clickable and you can move trough the set of images in the product description. So the path seems to be correct; I've copied them to my image directory in catalog. Even after I've set the images to be visible all the time (not on hover only) they don't show up. Close.gif is there though. Anypne know what's causing this? Couldn't find the solution on the Lightbox message board on huddletogheter.com either, although it was adressed in 1 topic....

Hi could i know how you get lightbox to work with all the extra images?

 

this is my product_info.php

---------------------------------------------

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

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_ADD_IMAGE, 'pID=' . $product_info['products_id']).'" target="_blank" rel="lightbox" '. '\\\')">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');

//--></script>

<noscript>

----------------------------------------------

 

it shows the lightbox popup, but it keeps going and going, no image is display.

 

Please help me!!

Share this post


Link to post
Share on other sites
I installed the Additional Images contribution and got it to work on extra images with the lightbox by grouping them in product_info.php and additional_images.php. One thing though: I can't get the prev.gif and next.gif to appear in the lightbox. They are active because the right and left side are clickable and you can move trough the set of images in the product description. So the path seems to be correct; I've copied them to my image directory in catalog. Even after I've set the images to be visible all the time (not on hover only) they don't show up. Close.gif is there though. Anypne know what's causing this? Couldn't find the solution on the Lightbox message board on huddletogheter.com either, although it was adressed in 1 topic....

 

Are you sure you've got the lightbox css pointing to the images in the right folder? I've got my lightbox css page in catalog/lightbox/css and my lightbox images in catalog/lightbox/images. The url I'm pointing to is as below:

#prevLink:hover, #prevLink:visited:hover { background: url(../images/prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(../images/nextlabel.gif) right 15% no-repeat; }

 

Is it the same for you? If so, doublecheck that the images have been uploaded to the server properly, and that you're not just looking at what you have on your local computer (have done this a few times myself :blush: )

 

Janna

Share this post


Link to post
Share on other sites
Hi could i know how you get lightbox to work with all the extra images?

 

this is my product_info.php

---------------------------------------------

?><script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_ADD_IMAGE, 'pID=' . $product_info['products_id']).'" target="_blank" rel="lightbox" '. '\\\')">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
<noscript>

----------------------------------------------

 

it shows the lightbox popup, but it keeps going and going, no image is display.

 

Please help me!!

 

 

The cycling most likely means one of two things (in my experience):

 

- The picture isn't uploaded in it's large version. Check that you uploaded the image properly (both the small version and the enlarged version). Assuming it was installed properly, this is probably the case.

 

OR

 

- The code above isn't telling your lightbox to look in the right database field. This should only be a problem if you've been messing around with the original code or database structure, or didn't install it properly. It could be a number of things, but check first that you ran the SQL query and that it changed the database correctly.

 

 

Janna

Share this post


Link to post
Share on other sites
Hi could i know how you get lightbox to work with all the extra images?

 

this is my product_info.php

---------------------------------------------

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

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_ADD_IMAGE, 'pID=' . $product_info['products_id']).'" target="_blank" rel="lightbox" '. '\\\')">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');

//--></script>

<noscript>

----------------------------------------------

 

it shows the lightbox popup, but it keeps going and going, no image is display.

 

Please help me!!

Hi, which contribution did you install to get extra images? Was it Additional Images Ultrapics or what? The javascript code is working fine, from what you've told.

But I can see that you didn't group the images; at least not in your product_info.php.

This is what the images link looks like in my product_info.php, maybe it helps... I used the contribution "Additional Images".

<script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox[product]" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') .'</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_pop']) . '" target="_blank" rel="lightbox[product]" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image_pop'], $product_info['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_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_pop']) . '" target="_blank" rel="lightbox[product]" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image_pop'], $product_info['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>

<?php require(DIR_WS_MODULES . FILENAME_ADDITIONAL_IMAGES); ?>
           </td>
           </tr>
           </table>

 

The lightbox code in my additional_images.php does also contain the group link for the images set: rel="lightbox[product]"

Share this post


Link to post
Share on other sites
Are you sure you've got the lightbox css pointing to the images in the right folder? I've got my lightbox css page in catalog/lightbox/css and my lightbox images in catalog/lightbox/images. The url I'm pointing to is as below:

#prevLink:hover, #prevLink:visited:hover { background: url(../images/prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(../images/nextlabel.gif) right 15% no-repeat; }

 

Is it the same for you? If so, doublecheck that the images have been uploaded to the server properly, and that you're not just looking at what you have on your local computer (have done this a few times myself :blush: )

 

Janna

Hi Janna, thanks for replying! The path to images is correct, they are in images map in catalog. The instructions said to also copy them to that directory.

So I have them in lightbox/images, but also in catalog/images. I've changed paths to see the effect. Still no visible next or prev.... :huh:

Share this post


Link to post
Share on other sites

Thanks for the help..

 

If i don't use the lightbox feature, everything works.. i can see the small, medium and large images. in pop up style. Of course i wanted the good looks of the lightbox. WHen i put the lightbox script on, it will shows only the lightbox screen but no image will show on popup. I believe lightbox can't retrieve the pop up image.

 

JSR i have try to copy your code into my product_info.php only to get a lightbox pop up of a small image. So i believe lightbox will only work with one image?? will it work with the small, medium and large image on the one product? Or is they a way to tell lightbox to display the large image only when click ?

 

JSR what do you mean when you say "The lightbox code in my additional_images.php does also contain the group link for the images set: rel="lightbox[product]"

 

DO you mean the /admin/additional_images.php? how do i add the group link for the images set? can you post your code please?

 

Thanks so much for your help !!!

Share this post


Link to post
Share on other sites

Hi Andrew, I meant the additional_images.php in catalog/includes/modules.

Here is my code for that file. Hope it helps.

<?php
/*
 $Id: additional_images.php,v 1.0 2003/02/28 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 AUTHOR: Zaenal Muttaqin <zaenal@paramartha.org>  
 Released under the GNU General Public License  

 Modified by Eyal Shoabi, 14 Feb 2008
 Compatible with Additional Images Ver 1.11 
*/
?>

<?php
 $images_product = tep_db_query("SELECT additional_images_id, products_id, images_description, medium_images, popup_images FROM " . TABLE_ADDITIONAL_IMAGES . " WHERE products_id = '" . $HTTP_GET_VARS['products_id'] . "'");
 if (!tep_db_num_rows($images_product)) {
?>
<br>
<?php
 } else {
?>
<!-- additional_images //-->
<table width="100%">
      <tr>
           <td class="ProductHeader"></td>
       </tr>
  <tr>      
    <td>

<?php
 $info_box_contents = array();
 $row = 0;
 $col = 0;
 while ($new_products = tep_db_fetch_array($images_product)) {
   $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="33%" valign="top"',
                                          'text' => '<a href="' . tep_href_link(DIR_WS_IMAGES . $new_products['medium_images']) . '" target="_blank" rel="lightbox[product]">' . tep_image(DIR_WS_IMAGES . $new_products['medium_images'], $new_products['images_description'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . /*'<br>' . TEXT_CLICK_TO_ENLARGE . */'</a>'
                                         );
   $col ++;
   if ($col > 2) {
     $col = 0;
     $row ++;
   }
 }
 new imagesBox($info_box_contents);
?>
    </td>
  </tr>
</table>
<!-- additional_images_eof //-->
<?php
 }
?>

Edited by JSR

Share this post


Link to post
Share on other sites

thanks chanel!

 

I found out that i am using the v2.0.0 and it doesnt have the /catalog/include/modules/additional_images.php

but by looking at your script i got it to work by changing the $product_info['products'] to $product_info['products_image_pop'])

 

the script below:

 

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

document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_pop']) . '" target="_blank" rel="lightbox[products]" title="'.$product_info['products'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image_med'], $product_info['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

//--></script>

<noscript>

 

thanks for all the help guys!

Share this post


Link to post
Share on other sites

That's great, Andrew!

 

I still didn't manage to get the prev en next visible, so if anyone has a clue to why it's not happening for me, please do post here.

I've tried everything i can think of, but no luck yet...

Share this post


Link to post
Share on other sites

Hi chanel,

 

I manage to get the Next and Previous on the lightbox to work. Just a reminder i am using the V2.0.0 Not the V1

 

i added lightbox[products] at: includes/classes/displayimages.php

----------------------------------------------------------

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

document.write(\'<a href="' . tep_href_link(DIR_WS_IMAGES . $addimages_images[$item]['popimage']) . '" target="_blank" rel="lightbox[products]" >' . tep_image(DIR_WS_IMAGES . $addimages_images[$item]['image'], $addimages_images[$item]['desc'], $addimages_image_width, $addimages_image_height, 'hspace="5" vspace="5"') . '<br>' . (!empty($addimages_images[$item]['desc'])?$addimages_images[$item]['desc']:TEXT_CLICK_TO_ENLARGE) . '</a>\');

----------------------------------------------------------------

 

product_info.php still the same:

-----------------------------------------------------

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

document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_pop']) . '" target="_blank" rel="lightbox[products]" title="'.$product_info['products'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image_med'], $product_info['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

//--></script>

------------------------------------------------

 

hope this help.

Share this post


Link to post
Share on other sites

Thanks for replying, Andrew. I'm using version 2.2 and don't have this file. Will take a look at the code though...

Share this post


Link to post
Share on other sites

hi just wondering has anyone managed to solve the issue of having to click the x/close button twice before the lighbox closes?? any help would be muchly appreciated :)

Edited by Misery_Kitty

The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer - Ken Kesey .................................

Share this post


Link to post
Share on other sites

Bug maybe -

 

I've got the rev with the addslashes but any images with underscores in the name (and I've got a lot of them) fail to show up (and hence pop because they are not even displayed on the product detail page - nada, no red x's nothing). Images without underscores work just dandy, so thanks for the nice addition. Any supercoders care to take a whack at this..?? Bog stock V2.2 rc2 and that works just fine as well when I revert back to the default product_info.php

 

Thx,

 

HOHO

Share this post


Link to post
Share on other sites

I am having some very minor issues with this contrib it works great with 90% of my images though i have a few products with apostrophes and breaks and it cuts off the products name in an odd fashion, for example

 

http://oscommerce.washwayusa.com/product_info.php?cPath=32&products_id=67

 

as well as one pesky image that makes the lightbox window size oddly, you'll see what i mean if you take a look at the following link

 

http://oscommerce.washwayusa.com/product_info.php?products_id=118

Share this post


Link to post
Share on other sites

I have the ultrapics + lightbox installed.

 

If I don´t have a large image in the folder the script still adds the image enlarge button to the small product image.

Thus the following light box popup will hang up in it´s upload mode, because there is no picture to load.

 

Is there any setting to avoid this, or must I add code to solve the problem?

 

Please help

 

Peter

Share this post


Link to post
Share on other sites

Hi there.

 

I've found this topic only now... :blush:

 

BTW

 

Before this addon (lightbox) I used this but lightbox is better

 

I use a flash image, in all page, and in the product info when the popup appears the flash image disappear....this don't happening if I use the older javascript...

 

Anyone have any idea why?

 

So another "problem": I've noticed that the popup image isn't on the center but always Xpx from the middle top, ther's any way to fix this?

 

Tnx, Jo

 

If you want to see disappear the flash image the url is this, just select one product and the popup image. The shop is still in testing :-)

Share this post


Link to post
Share on other sites

Hi,

 

This is for Misery_kitty and anyone else having the 'close' problem where scroll bars appear on the first click of the close cross and it closes on the second click.

I discovered it only seems to happen in Firefox on my mac (not sure about ie) but Safari is fine. Anyway i just changed a style in the lightbox stylesheet as follows and lightbox now works as it should.

 

Find in lightbox/css/lightbox.css

 

#imageDataContainer

 

...and change

 

overflow: auto;

 

...to

 

overflow: hidden;

 

Hope that helps.

 

Cheers

 

Janice

Edited by janice171

Share this post


Link to post
Share on other sites

*hugs* you're a legend!!! i really cant thank you enough!! if i can help out at all with anything don't hesitate to ask!!! i'd love to return the favor.

 

worked like a charm and i was about to give up lol... thanks Janice!!! :D


The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer - Ken Kesey .................................

Share this post


Link to post
Share on other sites

Having placement issues. With IE, I have the image box centered in the top of the screen, right under the tool/address bar. In Firefox, the image is centered about an inch and a half down the page below the tool/address bar.

 

My preferece would be as close to the center of the screen as possible in both browsers. My images are generally around 200x200 and it really looks ridiculous (especially in IE) with the image so small, being stuck right up to the top. Heh.

 

I am having a heck of a time getting that accomplished through the CSS. Can't even seem to change the position slightly. Heh. Can someone point me in the right direction please?

Share this post


Link to post
Share on other sites

Hello,

 

I hope someone can help me.

Cause I like the fancy lightbox popup very much but it's not working

I downloaded v2.04

Copied the images and the lightbox (and put it on the server) and also made a modification of product_info.php

But the only popup I get is the old one!!

 

Can anyone take a look at the code or maybe there's another issue?

 

Thanks.

 

Lieke

the netherlands

 

<?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">

<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="lightbox/prototype.js"></script>

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

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

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

<script type="text/javascript" src="lightbox/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="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

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

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" 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="100%" 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="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<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="100%" 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 (($product_info['products_quantity']<>0) and ($product_info['products_price']>0)) {

echo '' . tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/in_stock.gif', IMAGE_BUTTON_IN_STOCK). '<br><br>';

}

else

{

echo '' . tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/out_stock.gif', IMAGE_BUTTON_OUT_STOCK) . '<br><br>';

}

?>

<?php

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

?>

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

<tr>

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

<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>

<br>

<?php

If (($product_info['products_quantity']<>0) and ($product_info['products_price']>0)) {

echo '<br>' . tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/in_stock.gif', IMAGE_BUTTON_IN_STOCK). '<br><br>';

}

else

{

echo '<br>' . tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/out_stock.gif', IMAGE_BUTTON_OUT_STOCK). '<br><br>';

}

?>

</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="2">

<tr>

<td class="main" colspan="2"><?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>

</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="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<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 If (($product_info['products_quantity']<>0) and ($product_info['products_price']>0)) {

echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);

}else{

echo tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/button_out_stock.gif', IMAGE_BUTTON_OUT_STOCK);

 

} ?></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="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- 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 //-->

<br>

</body>

</html>

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

CODE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×