Run jQuery after WooCommerce AJAX shipping method update
Correct Custom Event: updated_checkout
The code snippet in question was listening to the incorrect Woocommerce custom event.
The correct custom event to listen to in this case is updated_checkout
.
When selecting a new shipping method, Woocommerce fires an ajax call to update the cart totals to reflect the price of the shipping method selected, then triggers updated_checkout
.
So if updated_checkout
is listened to, rather than updated_shipping_method
, the script is fired as intended.