Community Add-Ons
| Maintainers: | Alexian |
Different Image Size - Product_info & frontpage
for osCommerce Online Merchant v2.2
I've tried many contributions so i could have an smaller image on mine frontpage
and a larger image on mine poduct_info page. But most of the contributions just simply didn't work
or i didn't getit. HEY no one is perfect! :P
Well i thought if i simply change it in the file it will be the same as i wanted. I've changed in the file just 1 thing.
Instead of SMALL image (what you can change in the admin), i modified it into the HEADING Image
So you can put an widht or an height to it via the admin -> configuration -> images
HELP NEEDED!
===============================
The only problem now is that the (main)image is bigger then the image wich is on the frontpage, because of this the picture isn't 100% pure/sharp.
If someone can help out it would be great.
Hi Alexian,
I am new to OSC and php but managed to find this "trick" that might help.
By changing the image name within product_info.php, you can specify a different image to display.
F.ex. in catalog/images you have two images, identical except one is bigger that the other:
Image1A.jpg 100x100 pixels big.
Image1B.jpg 500x500 pixels big.
In your products display, you use Image1A.jpg as your thumbnail image. When people click on the link and enter the product info page, product_info.php changes the image it looks at by taking the image name (Image1A.jpg) removing the last 5 characters (A.jpg) and adding "B.jpg" instead, which makes the page display Image1B.jpg.
Here's how to do it:
1. BACKUP!
2. Open product_info.php and look for:
document.write('<?php
echo '<a href="javascript: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>';
?>');
3. Replace this with:
document.write('<?php
$product_substr = $product_info['products_image'];
$product_substr = substr($product_substr,0, strlen($product_substr) - 5) . "B.jpg";
echo tep_image(DIR_WS_IMAGES . $product_substr, addslashes($product_info['products_name'])); ?>');
What this does is:
a) Displays ImageB.jpg
b) removes the link "click to enlarge"
c) Changes the image, so that it doesnt link to the pop up window.
REQUIREMENTS:
1. The naming convention of images is important so that the correct number of characters are removed and replaced by the right characters.
2. Images are stored in catalog/images (This can be changed, but I haven't had the chance to experiment with that)
I hope this helps.
Any questions e-mail me:
Noel_Magno@hotmail.com
Note: the attachment is empty
