This is an awfully specific and awfully challenging issue. I know my chances of finding someone else with this problem are slim, but I have to try. I’m stumped.
I’m using Drupal 6, Ubercart, and the Option Images module.
I would like it to switch product images as different attributes are selected.
This works for certain images, but not for others. It seems to be tied to the attribute set, not anything about the image files–I’ve tried the same image on lots of attribute sets. I’ve also tried creating different attribute sets to see if I could figure out what aspect of the attributes is making option_images not work. No luck so far.
The Problem
- For certain groups of attributes, option images will upload but they do not display on the product page.
Things I’ve Learned
- Even for products that show broken option_images behavior, the images are uploaded. I see them in the database in the files table and on the filesystem.
- There is an array on the product page I can see: ‘$node->option_images’. This array is populated for working product pages, and not populated for product pages that don’t show option images.
- When I turn on the database debugger, I can see that the database is queried (uc_option_image_load). On the broken pages though, it queries for images for the wrong product. (eg: it looks for sharp cheddar option images when it’s on the swiss almond page) These products use different attribute sets.
Screenshots



I found it. The fact that it allows me to upload and preview option_images put me on the wrong path. It is actually a setting which enables and disables attributes for option images.
The setting is here: admin/store/settings/attributes
I think this is a usability bug, since letting me upload images for disabled attributes confused the heck out of me. But anyway. Solved.
Seriously questioning the Drupal way right about now.