uc_option_image inside views / with more than one product on one page
arbel - July 20, 2008 - 11:51
| Project: | Ubercart Option Images |
| Version: | 5.x-1.0-beta |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
Hello,
I have a list view with one product. I'd like to have the option image appear in the view and change when different attributes are selected. is there views integration?
thanks

#1
Currently the image switching only works when a node's full page is being viewed and will not work for teasers. sorry!
#2
Hi tjholowaychuk,
Is this still the case? If so, can I help with this? Any tips you have about where work needs to be done would be great -- I'm hoping it would be faster for you to point me in the right direction than go hunting because I'm also busy with other projects, but this would be a great feature for one D5 site I'm working on.
THanks :)
Scott
#3
Hi tjholowaychuk,
I now see that this isn't an issue about teasers per se, but about displaying multiple nodes on the same page.
From README.txt
I'm not sure how much help this will be, but another module that uses js to update the product node per attribute option is
Ubercart Ajax Attribute Calculations: http://drupal.org/project/uc_aac -- That module's js works ok with multiple nodes displayed on the same page. I wonder if there's any clues in there about how to deal with the drupal_add_js() issue you mention in the README (assuming this is the same issue as op?).
Thanks in advance for considering this issue, I know it's old - but since UC is not ready for D6, this D5 module is still a really great feature, if we could just get Views integration working :)
#4
there are ways around that issue for sure, they just seemed pretty hack-ish, and unfortunately I may be moving on from Drupal as a framework all together so I dont currently have time to work on some of my older modules.
#5
The problem is how array_merge_recursive (in drupal_get_js) behaves with numeric keys. See #208611-15: drupal_add_js includes settings twice.
The problem can be solved by using string keys instead of numeric keys:
[$nid][$aid][$oid]becomes["node-$nid"]["attribute-$aid"]["option-$oid"]This needs changes in uc_option_image.module and uc_option_image.js. Unfortunately my own version of uc_option_image is hacked so much that it would not make a nice patch. I attach a 7z of my hacked version. No guarantees whatsoever. It also has a slightly different fading effect (but you can change that back if you want).
#6
it's rather a feature request.