Last active
July 11, 2019 18:11
-
-
Save imran-khan1/250203ab1965f40c6962d4893b6fe8e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
update cart on quantity field value change | |
*/ | |
add_action( 'wp_footer', 'wc_qty_change_update_cart' ); | |
function wc_qty_change_update_cart() { | |
if (is_cart()) : | |
?> | |
<script> | |
jQuery('body').on('click', 'div.woocommerce .qty', function(){ | |
jQuery("[name='update_cart']").trigger("click"); | |
}); | |
</script> | |
<?php | |
endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment