Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Balakrishnan-flycart/1d23185ab434eb8e515671c9d7b5666a to your computer and use it in GitHub Desktop.
Save Balakrishnan-flycart/1d23185ab434eb8e515671c9d7b5666a to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - Refresh checkout when change payment
add_action('woocommerce_review_order_before_payment', function(){
if (!is_cart()) {
?>
<script type="text/javascript">
(function ($) {
$('form.checkout').on('change', '.shipping_method', function () {
$('body').trigger('update_checkout');
location.reload();
});
})(jQuery);
</script>
<?php
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment