I am using the "Other" payment method to complete orders that can be fully paid with a coupon. Unfortunately, even though the payment summary is refreshed when a coupon has been applied, the choice of payment methods still includes those that no longer satisfy their conditions (such as order total > 0), while Other (satisfied when order total = 0) does not show. Reloading the entire page in the browser corrects this, by adding and removing the payment methods, but I cannot expect the user to do that.

Is there any way to force a refresh of the listed payment methods when a coupon has been applied?

Many thanks.

CommentFileSizeAuthor
#1 1316464-update-payment-method.patch841 byteswodenx

Comments

wodenx’s picture

Status: Active » Needs review
StatusFileSize
new841 bytes

Please test the attached patch. Ultimately I think this needs to be generalized, perhaps with a system setting that allows admin to specify which checkout panes are updated when a coupon is applied.

Rafal Lukawiecki’s picture

I have just applied and tested the patch, and it almost works, but not quite. This is what I have found:

  • When applied on an otherwise unpatched ubercart, this patch did not seem to work, that is applying and removing coupons did not change the listed payment methods at all.
  • After applying patch 1373236-ajax-rework-10.patch in addition to the patch that you have just provided, something is happening. The payment methods pane updates, but incorrectly: it lags behind the coupon operation. What I mean, is that after the coupon is applied, the payment methods do not update. However, when the coupon is removed, the payment methods are updated to the options that they should have been when the coupon was applied just earlier. When, again, a coupon is applied, payment methods update, but this time to those that should show if no coupon was applied, and so on.

If you think I should test it again on a different installation of Ubercart, I would be happy to try it a few more times, but I thought I would report to you now, just in case you have an idea what might be causing this issue.

Many thanks.

wodenx’s picture

Status: Needs review » Postponed (maintainer needs more info)

Yes you're right you need that patch (forgot i had it applied on my system) - however, with both patches it works as expected for me - I can't reproduce the behavior you describe. But I also cannot reproduce the behavior you describe at #1373236: Allow multiple modules to react on checkout Ajax events #14 - so something else is interfering with ajax requests from your page - maybe your theme? Try reverting to bartik and see if the problem goes away - and/or maybe try on a fresh drupal/uc 3.0 install....

Rafal Lukawiecki’s picture

I have recreated a new site, on a different server, using my current theme and the same set of modules, and the problem still persists. I have then disabled my theme and switched to Bartik, and the problem is still here. I agree with you, however, that this problem and the one, which I described in my comment to #1373236: Allow multiple modules to react on checkout Ajax events seem to be related. The reason I think so, is because when I click the "Update Order" or "Apply to order" buttons available on the Coupon pane, even without using a coupon, it correctly refreshes the payment methods pane and the payment summary.

So, to summarise, having applied both patches, I am experiencing this:

  • When I apply a coupon, payment summary is correctly updated, but the payment methods are not
  • When I change the country, the payment summary is not updated, even though taxes have changed
  • When I click the Update Order or Apply to order buttons on the coupon pane, both the payment summary and the payment methods update correctly
  • When I just remove/add/remove... coupons, the payment methods pane is updated, but it lags a change, so it shows the opposite to what it should show
  • If I just reload the page using the browser, both payment methods and summary are shown correctly

I am not sure if there is, perhaps, interaction with any other module, or perhaps the way my modules have been installed (uc_coupon directory is inside ubercart directory) or anything else. If you have any ideas what else I could test, check, or change, please let me know. I tested it in IE9, Chrome, Firefox, and Safari, on both W7 and OS X. It would be great to have this working on my site... Many thanks and I really appreciate your help, perhaps I could reciprocate somehow.

Michael-IDA’s picture

Hi Chris,

Ultimately I think this needs to be generalized, perhaps with a system setting that allows admin to specify which checkout panes are updated when a coupon is applied.

Would probably be the 'nicest' from an User point of view. And even just being able to specify what gets to react on checkout Ajax events would be handy.

But in the interim, does the patch in [1373236] need to be re-rolled for -dev?

Or, maybe it'd be better to ask what version of ubercart and what version of uc_coupon should these two patches be applied to for testing?

Thanks,
Sam

wodenx’s picture

@sam-inet - I updated the patch int #1373236: Allow multiple modules to react on checkout Ajax events to apply to current uc DEV, and posted an interim patch for uc_coupon to update the shipping methods at #1473062: Update shipping methods when coupon is applied.. That one will be superseded when the more general solution is implemented.

@rafal - Please try the latest versions of uc/uc_coupon with the patches and report back in either thread.

wodenx’s picture

Status: Postponed (maintainer needs more info) » Postponed
Rafal Lukawiecki’s picture

Will try early next week with the new patch. Thanks.

Michael-IDA’s picture

@Chris,

I'll have time next week to test these.

Best,
Sam

Rafal Lukawiecki’s picture

Are these patches available for 3.2?