Despite the fact that this module is not actively supported, it is still very necessary.
Another, no less important module is the module Ubercart Ajax Attribute Calculations (2 branch).
I can't get them to work together.
Is there someone who did it? You can share the experience?

What I need?
I have Ubercart Attribute with two options:
Weight
-- 100 g (10$)
-- 400 g (30$)
When I set ACC dynamically adjusts attribute price Ubercart Option Images not switch images. Without enabled ACC option images work fine.

Comments

kirbaranov’s picture

same things...

BrainBurner’s picture

Status: Active » Patch (to be ported)
FileSize
1.31 KB
858 bytes

I had the same problem, and I managed to solve it modifying both uc_aac and uc_option_image.

I created two patches for those files, I hope it works for you too, since it is the first time I create a patch....

zarudny’s picture

Yes, it's working!
Thanks a lot, man. Your patches was very helpful for me ;)

cybis’s picture

I'm getting the following errors applying the patch against an unpatched uc_option_image.js v 6.x-1.4:

Hunk #2 succeeded at 30 with fuzz 2 (offset -2 lines).
Hunk #3 FAILED at 44.
Hunk #4 FAILED at 52.

It looks like this patch was created from an already modified uc_option_image.js (my first time trying to patch anything, so the fault is likely mine.)

cybis’s picture

Ah! Don't mind my previous post. The patch works against this version of UCOI: http://drupal.org/node/550344#comment-2113120.

cybis’s picture

The uc-aac patch causes uc-aac to stop working in my installation. Actually, I got it to work. The issue was with patch.exe setting permission wrong under windows 7. On with testing now...

cybis’s picture

Thanks BrainBurner! It works for me too now.

ddbell’s picture

This is not working for me. This is what I get when I apply the patch:

btrubel0@btruu.com [~/public_html/eleganteventflowers.com/sites/all/modules/uc_option_image]# patch < uc_option_image-working_with_uc_aac.patch
(Stripping trailing CRs from patch.)
patching file uc_option_image.js
patch unexpectedly ends in middle of line
Hunk #4 succeeded at 54 with fuzz 1.

Please point me in the right direction. Thanks.

cybis’s picture

Did you apply the patch to the version of uc_option_image found in the link in post #5?

hatznie’s picture

Do you guys think simular patches are needed in my case (http://drupal.org/node/711348)?

I was having a simular problem where my images wouldn't switch using this module together with the Display Suite (http://drupal.org/project/ds) and Node Display (http://drupal.org/project/nd) modules. If so, do any of you know how those patches would look like? I'm not drupal savvy enough atm to come up with my own patches.

Thanks in advance.

khizerjalal’s picture

WOW, works perfect.. Thanks for nice patches :P

AdroAdro88’s picture

Please note: The patches listed here do not work with the jQuery Update Module. Luckily I don't require this module anymore... ;)

Thanks for your hard work...

-A

sumaiyajaved’s picture

Thanks a lot for the two patches ... saved my day or should i say week :)

fearlsgroove’s picture

Status: Patch (to be ported) » Needs review
yannickoo’s picture

cybis’s picture

Looks like this patch is not compatible with the lastest version of uc_aac. (2.x dev).

yannickoo’s picture

The 2.0 is okay or should I use the 1.x?

cybis’s picture

I got it to work with uc_aac 2.0 but not with uc_aac 2.x_dev.

yannickoo’s picture

Hm...now I'm using 2.0 but onchange the images doesn't change :(

yannickoo’s picture

The reason is the uc_aac module, if I disable it, it works ...

cybis’s picture

Ok, I think I got these modules to work together:

  • uc_aac-6.x-2.x-dev
  • uc_option_image-6.x-1.4
  • uc_dependent_attributes-6.x-1.x-dev

uc_aac.js was modified to work with UCOI and UCDA. (uc_aac-6.x-2.0 is not compatible with PHP 5.3 but this version based on 2.x-dev is).
uc_option_image.js was patched with the patch found here.
UCDA wasn't modified.

Don't use attached files. See post #27.

yannickoo’s picture

Yeah! That works.

Status should be fixed I think :)

Thaaaaanks!

cybis’s picture

Yeah!

I think status 'need review' is appropriate for the time being.

cybis’s picture

FileSize
5.21 KB

Here the patch for uc_option_image.js (against 6.x-1.4) related to post #21.

Don't use attached files. See post #27.

yannickoo’s picture

A second patch? Why?

cybis’s picture

No, this is the first 'patch'. The files in post #21 is all you need. The patch in post #24 is the patch needed to get you from an unmodified version of uc_option_image.js v.6.x-1.4 to the version in post #21. (so that people can see what changed).

cybis’s picture

FileSize
5.22 KB
20.19 KB

I modified Uc_option_image.js (again) to work on aac’s Ajax delivered content by being called with Drupal.attachBehaviors() in uc_aac.js.
This is a better approach because the latest dev release of uc_aac now works with this patched UCOI (but not with dependent attributes.)

kansaj’s picture

It works, the problem is that it doesn't work on non-main-root directories.
www.xx.xx/store/.... is interpreted as www.xx.xx/...

Cheers

yannickoo’s picture

cybis? I removed $content from my node.tpl.php and now I print the price with php. But uc_aac doesn't calculates the price now.

How can I fix that?

Thanks

Yannick

pasive’s picture

Hi for me worked in such way

First all patches from up to http://drupal.org/node/550344#comment-2997684

Then manually without patching /node/712542#comment-2632392, and only uc_aac patch.

Images are switching but still I need to disable First required attribute then default image only shows, but thanks to tourtools who at least found the problem at http://drupal.org/node/921580

At least I can start to think about how to solve it.

P.

acouch’s picture

Category: bug » feature

This module is now being supported and I am interested in adding the patches above. For now marking as 'feature request'.

jason.bell’s picture

Glad to see maintenance on this module coming back. FWIW, I finally got uc_option_image install to work without errors and all functionality triggered using files from http://drupal.org/node/712542#comment-3432842. Would love to be able to display all option images at once in the future. Thanks acouch for picking up the issue queue!

tchurch’s picture

subscribing...

cybis’s picture

Component: Code » Miscellaneous
FileSize
357 bytes

This patch applies to the new 6.x-1.x-dev release.
It only adds this code:

Drupal.behaviors.UCOI = function() {
  UCOI.init()
}
cybis’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Component: Miscellaneous » Code
arirasekh’s picture

Component: Miscellaneous » Code

Hey Cybis,
I'm trying to resolve the UCOI and UCAAC not playing together (i.e. option images not updating when UCAAC is enabled). I use the version you attached of UCOI along with uc_aac 6.x-2.x-dev which I think is what you were suggesting. The result crashes my site (i.e. white screen). Any ideas?

cybis’s picture

FileSize
19.44 KB

Try this. This is UCOI as currently installed on my site. 6.x-dev + patch #34.

arirasekh’s picture

Cybis - thanks a ton. This worked. Quirky thing though is that the option image only changes if the attributes "Required" preference is unchecked (otherwise I get the "no image" clipart). This probably isn't critical but it doesn't seem "right". Let me know if you have thoughts on this. Thanks again.

cybis’s picture

@arirasekh, you are correct, 'required' currently needs to be unchecked. Don't know a workaround.

acouch’s picture

cybis , if you make a patch out of this I can review it and put it in the module.

cybis’s picture

@acouch, thanks. See post #34 here for a patch.

cybis’s picture

Status: Needs review » Reviewed & tested by the community
stewart.adam’s picture

+1 for using Drupal behaviours as the proper way to resolve this, but there's a bit more we can do:

  • Use the context returned by other modules to only react if the part of the document that was changed relates to the add to cart form
  • We no longer need to call UCOI.init() upon page load as Drupal.behaviors is automatically run once DOM is ready (the "context" variable is the entire document)

Attached patch fixes these issues.
Edit: I've just noticed that the call to "UCOI.init(context)" is missing a semicolon in the attached patch. Because there's only one statement in that code block it doesn't matter and it's not worth re-uploading but just wanted to mention it in case.

tchurch’s picture

Status: Reviewed & tested by the community » Needs work

Patch (zip) file in #37 worked for me for the options edit page but it doesn't change the images on the product view.

I've even manually applied the changes from #43 to the file but this didn't help.

is anyone dealing with these issues anymore?