I checked in Chrome console that (document).ready
fires when the relevant HTML elements are not present in DOM yet. Any idea why it happens? The code goes to QtyChng
function and only highlights the selector line. This should be fine as it applies the event listener, but as it happens too early, this listener won't work.
(function($){
$(document).ready(function(){
QtyChng();
});
function QtyChng() {
$(".woocommerce form.cart, .woocommerce td.product-quantity, .woocommerce li.product").off("click", ".qib-button").on( "click", ".qib-button", function() {
// do stuff
});
}
})(jQuery);