Download & Extend

Compatibility with Ubercart Ajax Attribute Calculations module

Project:Ubercart Option Images
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

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

#1

same things...

#2

Status:active» patch (to be ported)

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....

AttachmentSize
uc_aac-working_with_uc_option_image.patch 858 bytes
uc_option_image-working_with_uc_aac.patch 1.31 KB

#3

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

#4

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.)

#5

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

#6

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...

#7

Thanks BrainBurner! It works for me too now.

#8

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.

#9

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

#10

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.

#11

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

#12

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

#13

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

#14

Status:patch (to be ported)» needs review

#15

#16

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

#17

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

#18

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

#19

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

#20

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

#21

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.

AttachmentSize
uc_aac.zip 12.07 KB
uc_dependent_attributes.zip 10.81 KB
uc_option_image.zip 20.24 KB

#22

Yeah! That works.

Status should be fixed I think :)

Thaaaaanks!

#23

Yeah!

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

#24

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.

AttachmentSize
uc_option-patch.patch 5.21 KB

#25

A second patch? Why?

#26

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).

#27

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.)

AttachmentSize
uc_option_image.zip 20.19 KB
uc_option_image.patch 5.22 KB

#28

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

#29

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

#30

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.

#31

Category:bug report» feature request

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

#32

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!

#33

subscribing...

#34

Version:6.x-1.4» 6.x-1.x-dev

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

Drupal.behaviors.UCOI = function() {
  UCOI.init()
}
AttachmentSize
712542-uc_option_image.34.patch 357 bytes

#35

Component:Miscellaneous» Code

#36

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?

#37

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

AttachmentSize
uc_option_image.zip 19.44 KB

#38

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.

#39

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

#40

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

#41

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

#42

Status:needs review» reviewed & tested by the community

#43

+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.

AttachmentSize
uc_option_image-behaviors-712542-43.patch 1.32 KB