option images disappear when price calculation is updated

CommentFileSizeAuthor
#6 Ajax-conflict-1926630-5.patch9.25 KBantiflu
#1 1.jpg124.13 KBbenitezv1ang
1.jpg126.52 KBbenitezv1ang

Comments

benitezv1ang’s picture

StatusFileSize
new124.13 KB

Please check this image.
First image is wrong

minasshohdy’s picture

did anyone find a solution for this yet?

UK_Rogue’s picture

Same problem here, well spotted - this was doing my head in. If I recall there used to be another way of updating the price and image before this option was introduced. I'll see if I can find the post!

Additional: Raised an issue with Ubercart. http://drupal.org/node/1974604

Colin @ PCMarket’s picture

Issue summary: View changes

Hi UK_Rogue was just wondering if you ended up finding a work around for this conflicting behaviour.

antiflu’s picture

Hi, I am working on a patch.

The problem is that Ubercart uses the Ajax API to overwrite the radio buttons with an up-to-date version, that however fails to include the images.

I was trying to solve it the IMO 'proper' way, by making the images render in Ajax mode as well, so that on regeneration of the radio buttons the images would be included. But somehow, this doesn't work. This is not because the module uses Javascript to add the images, because the Javascript just responds to div and span elements added to the radio buttons by uc_option_image_add_to_cart_prerender. I would say that the real problem is that Ubercart in Ajax-mode re-renders certain form elements, but not the whole form, and thus the prerender function is not executed properly. But I don't succeed to fix this.

So my patch is based on another solution: to make the module modify Ubercart behaviour and not redraw the whole set of radio buttons but just the text associated with them, and leave the images as they are. When it is properly tested, I'll submit it here.

antiflu’s picture

StatusFileSize
new9.25 KB

The patch is attached to this issue.

At the same time, we also came across another issue which is that when the uc_product_kit module is used, the option images were not displayed. This issue was also solved by creating an extra function uc_option_image_kit_add_to_cart_prerender as a prerender hook to uc_product_kit_add_to_cart_form.

  • liberatr committed 93c7434 on 7.x-1.x
    Issue #1926630 by antiflu: Fixed Conflict with Ajax-ify attribute option...
liberatr’s picture

Assigned: benitezv1ang » liberatr
Status: Active » Fixed

I tested this out and it seems to work. I committed it and I am trying to make sure that "beta3" becomes the new recommended release on the project page.

Thanks Tom!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

orkineo’s picture

Hi,

I encountered the same problem with Beta3, I know that this module is not maintained anymore, just for info.
Maybe evolutions of ubercart...