Woocommerce – Update checkout on method payment change

add_action( 'wp_footer', 'pexlechris_custom_checkout_jqscript' );
function pexlechris_custom_checkout_jqscript() {
	if ( is_checkout()) :
	?>
	<script type="text/javascript">
	jQuery( function($){
		$('form.checkout').on('change', 'input[name="payment_method"]', function(){
			$(document.body).trigger('update_checkout');
		});
	});
	</script>
	<?php
	endif;
}

About Pexle Chris

I am a passionate PHP and WordPress developer with expertise in creating custom plugins and web applications. With a strong background in backend development and an eye for clean, efficient code, I specialize in building tailored solutions that enhance website functionality.

As a developer, I love diving into the WordPress ecosystem, crafting plugins that solve real-world problems, and contributing to the community by sharing insights and best practices.

When I'm not coding, I enjoy teaching web development and exploring new tools and technologies to stay at the forefront of web innovation.

📧 Contact: [email protected]
🌐 Website: You're already here!
💼 LinkedIn: pexlechris LinkedIn