• Resolved gtmdersleri

    (@gtmdersleri)


    I have some products are required input fields in product page. When input not filled and click add to basket button, plugin firing add_to_cart event. But it isn’t true. It must be fire only real add to cart actions.

    This issue has also on home page when click select options button (It redirects to the product page. Does not adding to cart yet.)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    If your site is using the standard WooCommerce classes the ‘add to cart’ button has the single_add_to_cart_button class, which is what GTM Kit uses to fire the add_to_cart event. On variation products where you i.e., must select a size the button also has a disabled class until a size has been selected. The disabled class prevents the add_to_cart from firing, so maybe this could be a solution for you.

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    @gtmdersleri In the comming version 1.12 of GTM Kit you can use the class disabled or input-needed to block the add_to_cart event. disabled is a standard WooCommerce class which disables the button. input-needed can be used if want the button to be active and handle missing input through input validation but this requires som customization on your site.

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Closing this as resolved

    Thread Starter gtmdersleri

    (@gtmdersleri)

    Hi Torben.

    Thanks for support.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add to cart triggered even when required input fields are not fill.’ is closed to new replies.