Created
July 29, 2025 13:43
-
-
Save stoffl6781/d571b6524c960ab1e5e663c3ace7187a 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
jQuery(function ($) { | |
let timeout; | |
const registerUpdateCartEvent = () => { | |
$(".woocommerce-cart-form").on("change", "input.qty", function () { | |
if (timeout !== undefined) { | |
clearTimeout(timeout); | |
} | |
timeout = setTimeout(function () { | |
$("[name='update_cart']").trigger("click"); | |
}, 750); | |
}); | |
} | |
$( document.body ).on( 'updated_cart_totals', function(){ | |
registerUpdateCartEvent(); | |
}); | |
registerUpdateCartEvent(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment