OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Product Images using Lightbox v2.04 - Contrib Help and post install tweeks
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Templates and Images
simaster99
Integrated into osCommerce 2.2
All credit to Lokesh Dhakar http://www.huddletogether.com/projects/lightbox2/
Files and installation for use in osCommerce sites can be found at
Please feel free to ask post install questions or any ideas for updates
Kind regards
simaster99
rscott
I've tried this on a completely fresh install of 2.2RC2a, but it doesn't seem to work - I get an error :-

Builder is not defined
http://webtest/osc/lightbox/lightbox.js
Line 132
objBody.appendChild(Builder.node('div',{id:'overlay'}));

I've tried amending product_info.php and adding builder to this line:

&lt;script type="text/javascript" src="lightbox/scriptaculous.js?load=effects,builder"></script> .

but this doesn't seem to fix the problem - I don't get the error anymore, but (in IE) don't get the original smaller image. Firefox displays the image, but nothing happens when I click on it.
simaster99
QUOTE (rscott @ Mar 15 2008, 04:46 PM) *
I've tried this on a completely fresh install of 2.2RC2a, but it doesn't seem to work - I get an error :-

Builder is not defined
http://webtest/osc/lightbox/lightbox.js
Line 132
objBody.appendChild(Builder.node('div',{id:'overlay'}));

I've tried amending product_info.php and adding builder to this line:

&lt;script type="text/javascript" src="lightbox/scriptaculous.js?load=effects,builder"></script> .

but this doesn't seem to fix the problem - I don't get the error anymore, but (in IE) don't get the original smaller image. Firefox displays the image, but nothing happens when I click on it.


Sorry,

This helps ...

Add the line

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

But above

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

product_info.php has been added to the contrib, sorry for the stupid mistake
invasi0n
Hi,

I couldn't get it work because lightbox.css was missing but now everything works great.

Thanks. thumbsup.gif
h3dave
So i tried your contrib and actually it works when I install al lof your fixes, the only trouble left is that it doesn't appear in front of the product when I use 'enlarge' button it appends to the page at the far bottom something like twice the size of the actual page. So I really thought it wasn't working then I saw my scrolling bar grow when clicking on the 'enlarge'. I went to the bottom and saw my pictures at the bottom left corner.

What about this?

Dave
cheeroke
Hello There,

I got one question, is it chance to add more images than one? If yes, how should I do it or do I need another addons?

Thanks
cheeroke
Hello Again,

now i got bigger problem as after instalation this contributions pound and euro symbols are displayed wrongly, pound is as Ł and euro is as ?
.... so fare as i change product_info.php in main directiory this addons not working but those symbols are displayed correctly but if i will replace it with this one with chnages according this contribution - it's work but symbols are wrong...

...has anybody got any idea where should I looking for bug?

I would be appreciate if somebody answered.

Thanks.
simaster99
QUOTE (cheeroke @ Mar 27 2008, 08:48 PM) *
Hello Again,

now i got bigger problem as after instalation this contributions pound and euro symbols are displayed wrongly, pound is as Ł and euro is as ?
.... so fare as i change product_info.php in main directiory this addons not working but those symbols are displayed correctly but if i will replace it with this one with chnages according this contribution - it's work but symbols are wrong...

...has anybody got any idea where should I looking for bug?

I would be appreciate if somebody answered.

Thanks.


Hi,

1. Open your working product info.php and from there add the following code, its in the install.txt file

2. Open catalog/product_info.php

Find </head>

just above add

<link rel="stylesheet" href="lightbox/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="lightbox/prototype.js"></script>
<script type="text/javascript" src="lightbox/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="lightbox/builder.js"></script>
<script type="text/javascript" src="lightbox/lightbox.js"></script>


3. Next you need to edit the code which displays popup images and add the relation to lightbox, rel="lightbox", you will find this lower down the product_info.php around line 108 staring with <script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow .

If you do a search for "ENLARGE" you should find it

With clean MS2.2 Find

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

Replace with

<script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" 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>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" 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>'; ?>');
</noscript>

4. Test and then upload to your live server
Bdevil
Hi!!
if i wish that the lightbox will open when mouse go over the image?
presodeminacion
This help me a lot !!! Thanks.

Esto me ayudo mas de lo necesario. Gracias !!
Ayder
Hi,

Primarily thanks. I installed this software in my programs. But I click to ENLARGE Button, product image view smaller from normal picture in pop-up windows. I not found to setting size. Please can you help me? (Note : OSC Version M2.2)

Best Regards.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.