Community Add-Ons
| Maintainers: | markus.bopp |
Multiple Product Images With Slide Show
for osCommerce Online Merchant v2.2
This contrib (hack) allows you to define as many product images as you want.
The images are shown as slideshow in product info. The slideshow images are resized and cached.
This is a fix for the navigation buttons.
I found the Next button worked fine but the previous button was trying to navigate to an invalid number in the array when you changed between forwards and backwards navigation.
=================================
In catalog/product_info.php
=====================
// ** REPLACE the entire slideFader function with:
function slideFader(direction){
if (direction == 1) {
if (backSlide==1){
slideStation=slideStation+2
}
alert(slideStation)
if(slideStation == slideList.length){
slideStation = -1;
slideImage = headImage;
slideImageOriginal = "<?=DIR_WS_IMAGES . $product_info['products_image']?>";
}else{
slideImage = slideList[slideStation];
slideImageOriginal = slideListOriginal[slideStation];
}
slideStation++;
backSlide=0;
forwardSlide=1;
}
if (direction == -1) {
if (forwardSlide==1){
slideStation=slideStation-2
}
alert(slideStation)
if (slideStation==-2) {
slideStation= slideList.length-1;
slideImage = slideList[slideStation];
slideImageOriginal = slideListOriginal[slideStation];
}else if (slideStation==-1) {
slideStation= slideList.length;
slideImage = headImage;
slideImageOriginal = "<?=DIR_WS_IMAGES . $product_info['products_image']?>";
}else{
slideImage = slideList[slideStation];
slideImageOriginal = slideListOriginal[slideStation];
}
slideStation--;
backSlide=1;
forwardSlide=0;
}
sPanel = document.getElementById("slidePanel");
sPanel.innerHTML = "<img src='"+slideImage+"' hspace='5' vspace='5'/>";
}
