"No Image" message: Images don't display in product pages

ccshannon - November 21, 2008 - 17:36
Project:Ubercart Option Images
Version:5.x-1.0-3
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,

I followed the screencast and tried over and over, switching from bluemarine to garland, but the images simply will not display in list view, product view, or any view except when editing the options for the product in the options edit screen.

On product views, instead of an option_image, I have the words "No Image". I can see my two image options (product color images, one called "black" and the other called "white") in the source HTML but they are hidden.

I'm using Drupal 5.12 and Ubercart 1.5.

I set option images in the admin preferences to be viewable by everyone, but it makes no difference. The "No Image" message is there no matter what I do.

Any ideas?

Thanks.

#1

ccshannon - November 21, 2008 - 18:03
Title:"No Image" message: Images don't siaply in product pages» "No Image" message: Images don't display in product pages

#2

ccshannon - November 21, 2008 - 18:22

More info ...

the best I could get was "No Image" message and switching the select box for "color" only created the fade effect switching from "No Image" to "No Image" again.

I got frustrated to the point that I created a a whole new attributes/options set, a new test product from scratch and added in the new color options and images all over again.

This time I got the "default" image, but when I use the selector to switch images, there is a quick "fade" effect, then the product image disappears entirely, no message. Then, no matter what I try switching to, I get no image at all.

Again, any ideas as to why I cannot get this to work would be greatly appreciated. Thanks.

#3

ccshannon - December 1, 2008 - 20:44

For some reason, I'm no longer seeing the "No Image" message when testing.

But the "switch images" feature, I cannot get working.

I have an item in two colors: "black" and "white".

I can make the "white" item show up in the product node, as the default image, but using the select box to select "black", dos nothing to the image.

I can switch the default image to "black", and indeed when I view the product node, the "black" item is displayed as the default image, but switching to "white" does nothing.

I understand the module is seeking a maintainer, so that would indicate the problem probably has no solution. Without the "switching" ability working, I'm not sure what to do.

The purpose of the module is to tie a product attribute option ("blue", "red", "white") to a matching product image, so that when one "selects" the option in the product node, the product image switches to the one matching the option.

I have tried turning it off and on, with thickbox and without, with one attribute enabled and with two, with no product images (imagefield) and with several. I did the screencast step-by-step. It just doesn't work for me.

Any ideas would be appreciated. Thanks.

#4

gurglemoo - February 1, 2009 - 22:33

I had the same problem, and it seems that the javascript is placing the image location address without the "/" in the beginning. This is the only reason mine isnt working.

ie. src="sites/default/files/option-images/Red_Dog.jpg" instead of src="/sites/default/files/option-images/Red_Dog.jpg"

#5

gurglemoo - February 2, 2009 - 14:35

okay I dont understand any of this bug fixing and stuff, I also don't understand Javascript but I managed to fix this particular problem:

Line 56-71 of the uc_option_image.js file :

/**
* Switch the imagepath based on the selected effect.
*/
UCOI.switchImageEffect = function(image, imagepath) {
var slashimagepath = '/' + imagepath;
switch(this.effect){
case 'fade':
$(image).fadeOut(200, function(){
$(this).attr('src', slashimagepath).fadeIn(200);
});
break;

default:
$(image).attr('src', slashimagepath);
}
};

(I added the line: "var slashimagepath = '/' + imagepath;" and then changed the next 2 occurances of "imagepath" to "slashimagepath") now it works perfectly!!

#6

ccshannon - February 5, 2009 - 02:11

Ah, good one! I actually ended up writing a module to have swatch images that don't override the product images - which needs a lot of polishing given it's the first module I've ever written.

I wonder if that .js slash will be a problem with the D6 port, which is being worked on:

http://drupal.org/node/294725

#7

gurglemoo - February 6, 2009 - 00:10

I've been using that D6 version (I think it was under post #12) with the mentioned .js edit and it seems to work okay - sortoff - it just happens to 'forget' the option images every once in awhile but apart from that its perfect :/

Also if you want to add a product image that doesn't get affected by the dropdown then just wrap it in a div with a different class/id to whatever the option-image is ( you can do this with http://drupal.org/project/contemplate )

 
 

Drupal is a registered trademark of Dries Buytaert.