I have some custom javascript tied to a link in add to cart form that has been added with hook_form_alter. On a click, all it does is retrieve some information and populate a text field. This works fine. It is added with a normal drupal_add_js call.
However, with uc_aac enabled and on a product with just a single attribute, it's like the click event on the link is never registered. Nothing happens. Even though none of the DOM has changed. It's like it stops some javascript from running. Other custom javascript is working fine, except this one click even on the link.
Any nods in the right direction would be appreciated. Thanks!
Comments
Comment #1
TravisJohnston commentedThis is an old post, but I just experienced this. I was trying to setup a function that will show/hide attributes depending on which other attributes you clicked. Works fine with AAC turned off, but when its on, AAC take priority and stops all other functions outside of it from working. In the console, i can get it to work "kinda" but thats about it.
Comment #2
TravisJohnston commentedThis is really bothering me. I tried changing the weight of the module in my DB but that didn't work. I can't use any JS on the form elements when this module is activated. What gives?
Comment #3
TravisJohnston commentedComment #4
deaftone commentedI'm having the same issue. Custom jQuery is not working with AAC enabled. I need this functionality. How to fix this?
Comment #5
TravisJohnston commentedHello @deaftone,
I managed to find someone that created a patch for it in there new module. http://drupal.org/project/uc_conditional_attributes
I can't find the original conversation but it took place on the uc_cano module forums. He not only created the conditional attribute module, but he also provides a patch to fix the way AAC reacts to other JS.
*Edit, just found the original conversation. http://www.ubercart.org/project/uc_cano?page=3
Comment #6
deaftone commentedHello Travis,
I will give this patch a try,
Thanks a lot.
Comment #7
deaftone commentedThe patch right here http://www.ubercart.org/project/uc_cano?page=3#comment-64313 does not work. Still the same result, and I've got weird numbers in text boxes.
Comment #8
RAWDESK commentedHello all,
I believe i am experiencing a similar symptom using the UC product attributes ajax api.
Only in my case it is not breaking a specific JS function, but influencing its (calculation) behaviour.
For some reason the incremental parameter for the add to cart amount (which is 1), gets increased by 1 on every aac event.
You can witness the symptom in this screencap :
http://castabo.rawdesk.be/temp/uc-product-attribute-event-bug.flv
Html source snippet containing the [-] amount [+] section :
Someone already found the cause for this JS interference ?
Thanks
Comment #9
RAWDESK commentedSolved my issue following this thread :
https://www.drupal.org/node/1255306
using the once() qualifier to force the handler only to be triggered once