Skip to content

Instantly share code, notes, and snippets.

@imran-khan1
Last active July 10, 2019 06:54
Show Gist options
  • Save imran-khan1/730ab9e9cf4e8afd4b54b7c7a4a8a435 to your computer and use it in GitHub Desktop.
Save imran-khan1/730ab9e9cf4e8afd4b54b7c7a4a8a435 to your computer and use it in GitHub Desktop.
<?php
/*
update cart on quantity field value change
*/
function wc_qty_change_update_cart(){?>
<script>
jQuery(".qty").blur(function(){
jQuery("[name='update_cart']").trigger("click");
});
</script>
<?php
}
add_action("wp_footer","wc_qty_change_update_cart");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment