- 🇩🇪Germany dercheffe Sersheim, Germany
Is there a workaround to solve this issue?
- 🇩🇪Germany dercheffe Sersheim, Germany
Trying to figure out if an ajax callback would be an option too. But no idea where to hook in and alter existing structures. commerce (sub)module has something similar functionality, when applying a coupon, then the order summary gets updated (and the order recalculated). See \Drupal\commerce_promotion\Plugin\views\area\CouponRedemption::ajaxRefreshSummary.
Is there a more generic solution than manipulate the billing information form? For example if you're using different forms depending on payment method (in my case commerce_stripe module). But I'm not sure how commerce_stripe gathers address information 🙈
- 🇮🇱Israel jsacksick
We have somebody from our team looking into this, the patch will be posted here in the upcoming days.
- 🇺🇦Ukraine tbkot
Here is the patch that should fix this issue. However, it needs to be adequately checked, maybe I've missed some cases. Let us know if you have any issues with this patch.
- 🇩🇪Germany dercheffe Sersheim, Germany
Thank you so much for the patch 🙏.
I tested it on my site installation. The default billing country is Germany (order summary is shown with VAT 19%).
I provide at my site two payment methods for the customer. Both payment methods are checked to collect billing information.
My payment methods provided:- stripe (see Module page → ) for credit card payments
- "Buy on invoice", a manual payment plugin, which does actually nothing, aside collect billing information for generating an invoice later via commerce_invoice module → . The user can pay later, sending the money manually via bank transfer.
I have following results after applying the patch:
Let's say the user is from Austria (VAT 20%) instead Germany. The user is a first time customer, no customer profile yet.
Test with Stripe
After filling out billing information and click on "continue to review" the order summary gets refreshed with 20% VAT. Works fine.
From a UX point of view it would IMO be nicer, the summary gets refreshed immediately as soon as the billing country in the address widget is changed. AFAIK the address field does a AJAX update of itself too when country is changed?Test with "manual" plugin
After filling out billing information and click on "continue to review" the order summary doesn't get refreshed. Here the patch doesn't work. The order gets only refreshed after waiting for refresh interval.
- Status changed to Needs work
over 1 year ago 10:09pm 20 June 2023 - 🇺🇸United States rszrama
I'm seeing some unexpected behavior in testing this patch myself. For my own testing, I just added a promotion that would appear when the billing country is UK. I could see this get applied once, but changing address selections triggered some sort of Ajax refresh that not only removed the adjustment when I went back to a US address but also overwrote the address associated with my prior payment method ... so a payment method with a UK address was changed to be associated with a US address.
I'm guessing this means we're attempting an update with partial or improper data in the wrong context due to the Ajax behavior. At first glance, I'm not sure where / how that may be, but I'm going to move this to "needs work" rather than "active" to show at least it has a starting patch.
- First commit to issue fork.
- 🇮🇱Israel jsacksick
Marking this as a "release blocker" even though this is technically not a blocker, but just for keeping track of issues I have in mind for 3.x.