Answer the question
In order to leave comments, you need to log in
How to update the price of a product when the quantity of products changes without reloading the page?
Hello!
There is this code:
add_action( 'wp_footer', 'cart_refresh_update_qty', 100 );
function cart_refresh_update_qty() {
if ( is_cart() ) {
?>
<script type="text/javascript">
jQuery('div.woocommerce').on('change', 'input.qty', function(){
setTimeout(function() {
jQuery('[name="update_cart"]').trigger('click');
}, 100 );
});
</script>
<?php
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question