Relative Content

Tag Archive for woocommercepayment-method

Latest Woocommerce checkout page handler payment

I make a custom plugin that use an external api to calculate the shipping cost on the checkout page.
A custom shipping method created also. alla works as expected but when the user change the payment method the refresh of the total and calculation of the shipping cost is not working.
in a script we have this part of code to trigger when payment method changed :
jQuery(document).ready(function($) {
$(document).on(‘change’, ‘input[name=”radio-control-wc-payment-method-options”]’, function() {
var paymentMethodId = $(this).val();
console.log(‘Selected Payment Method: ‘ + paymentMethodId);