Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Balakrishnan-flycart/77f62aa77b0f180c88c0e56f22e8d632 to your computer and use it in GitHub Desktop.
Save Balakrishnan-flycart/77f62aa77b0f180c88c0e56f22e8d632 to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - update checkout when change zip code
add_action('woocommerce_review_order_before_cart_contents', function (){
if ( is_checkout() ) { ?>
<script type="text/javascript">
jQuery('form.checkout').on('change', '#billing_postcode', function () {
jQuery('body').trigger('update_checkout');
});
</script>
<?php
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment