• bbdesignpa

    (@bbdesignpa)


    If a user starts typing numbers into the quantity input box on the WooCommerce shopping cart page, it is possible to fire a large number of add_to_cart and addProductToCartEEC events in quick succession, even if the user never clicks the Update Cart button. Is it possible to stop that from happening without modifying the plugin?

Viewing 1 replies (of 1 total)
  • This appears to be coming from lines 930-943 of gtm4wp-woocommerce-enhanced.js, which detects keypress events on the page and fires the function gtm4wp_handle_cart_qty_change() if the event’s target element is the same element or a child of another element that matches the CSS selector .woocommerce-cart-form input[type=number].

    In addition, when I typed 1-1-2, I expect the quantity in the event that is pushed to the data layer to be a number that is close to 112, but the quantity field contained the value 10.

    IMHO, cart quantity changes should not be tracked upon a keypress, but should be tracked on a more specific action, such as when a user clicks the Update Cart button.

Viewing 1 replies (of 1 total)
  • The topic ‘WooCommerce rapid-fires quantity change events’ is closed to new replies.