jQuery(document).ready(function () {
  var wpcbScrollToNotices;

  jQuery(document).ajaxComplete(function (e) {
    jQuery.scroll_to_notices = wpcbScrollToNotices;
  });

  jQuery(".woocommerce").on("change", "input.qty", function () {
    wpcbScrollToNotices = jQuery.scroll_to_notices;
    jQuery.scroll_to_notices = function (scrollElement) {
      return false;
    };
    setTimeout(function () {
      jQuery('button[name="update_cart"]').trigger("click");
    }, 200);
  });
});
