OsCommerce Contribution / Addon
When visitors will click the product thumbnail picture, Instead of appearing an ordinary popup, a screen centered overlay image will appear in his browser, while page will be visibile in the background. I have seen this code implemented in one another oscommerce addon, but that was a big package and you need to change many files for that.
But to install this addon you just need to replace only few lines of code and to place some additional files. The Lightbox2 is a simple, unobtrusive script used to overlay images on the current page. It’s a snap to setup and works on all modern browsers.
How to Install
Open the file
Catalog / product_info.php
1-Find <head> tag and add right below it. (Please don’t place it after other script including tags or stylesheet links, place it inside the head tag on top)
<link rel=”stylesheet” href=”css/lightbox.css” type=”text/css” media=”screen” />
2-Find this code around line no. 109
Replace it with
document.write(‘<?php echo ‘<a href=”images/’ . $product_info[‘products_image’] . ‘” rel=”lightbox” title=”‘ . $product_info[‘products_name’] . ‘”>’ . 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>’; ?>’);
That’s all you are done.
See it in action here, go to any product’s description page and click on the product image:
I use a high dimensions product images (300 x 300 size) in my Oscommerce store, so this addon works fine for me, because user can see the image clearly, but if you are using default OScommerce size (around 100 x 100) then this addon is not nice for you.
This addon is made with the help of Lightbox2 by Lokesh Dhakar
Feel free to contact me with any suggested enhancements or bugs. This addon could be used in any OsCommerce version, If you feel dificulty in implementing this, please contact me.
Yasir Imran Mirza