I have following problem:
During checkout, my customer has to fill in his billing address (at least at the first time) to calculate VAT rate and gross price. Further calculation is done via an order processor after that. So far it works fine.
My problem is, that the cart order refresh doesn't refresh the checkout panes (like the order summary) via AJAX, when the billing country (and so perhaps the valid VAT rate, too) has changed. The user has to reload the page in the browser actively or has to submit the form to see an effect, even if the order has been refreshed (and recalculated) behind the scenes already.
- How can I force a cart refresh and a recalculation via my custom order processor, independent from the cart order refresh interval?
- How can I trigger a reload for my checkout panes (in best case via AJAX, because of better UX), so that the user sees the changes just in time?
I found out that there have been hooks for that in D7 but in D8/D9 the hooks and services seem to exist no more (e.g.
commerce_cart_order_refresh() - see: How can I programmatically recalculate an order total after changing the billing country ).