- π¬π·Greece vensires
I followed the idea from #4 (thank you lubwn) and modified it accordingly to keep any currently selected payment method:
(function ($) { /** * Refresh the payment information about updating the shipping information. * * @see https://www.drupal.org/project/commerce_shipping/issues/3226851#comment-14761180 */ $(document).ajaxComplete(function(event, xhr, settings) { if (settings.extraData !== undefined && settings.extraData._triggering_element_name.indexOf( "shipping_information") !== -1) { let element = $('[id^="edit-payment-information-payment-method"]'); element .find('input:checked').prop("checked", false) .click(); } }); })(jQuery)
- Status changed to Needs work
about 1 year ago 8:12pm 29 August 2023 Here is a patch to update the selected payment gateway using #ajax callback.
It modifies the ShippingInformation::buildPaneForm() to set the payment_gateway order field when possible. This must be done before building the form and calculating the available shipments.The patch should be further improved before committing to be more general on form IDs but fixed the issue for me.
- last update
about 1 year ago 133 pass, 4 fail - last update
about 1 year ago 133 pass, 4 fail