• Hi,
    The add_to_cart event only trigger when we update the quantity of the product on cart page.
    Could you please apply the fixes ASAP to allow the add_to_cart event trigger while click on the add to cart button( class selector “.single_add_to_cart_button”) on the single product page?

    • This topic was modified 6 months, 1 week ago by Rajat Sharma.
    • This topic was modified 6 months, 1 week ago by Rajat Sharma.
    • This topic was modified 6 months, 1 week ago by Rajat Sharma.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Please go to ‘GTM Kit > Help > Support > Share system data with the GTM Kit support team’ and enter the support ticket: FS801-275CB

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    @gwlwp I’m here to help but you must to share your system data or it will be difficult for me to help you.

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    The add-to-cart button is single product page already based on the class .single_add_to_cart_button, so if it is not working for you somethings else is wrong.

    Since you have not shared your system data, I’m not able to investigate this further.

    Closing this for now

    Problem is with this line into this file /plugins/gtm-kit/assets/integration/woocommerce.js

    if ( eventTargetElement.closest( '.single_add_to_cart_button:not(.disabled,.input-needed)' ) ) {

    Change this to:

    if ( eventTargetElement.closest( '.single_add_to_cart_button' ) ) {

    @torbenlundsgaard Please, consider changing the behavior of the add_to_cart button script on the product page.

    Please, remove :not(.disabled,.input-needed)

    This my occurs problems into shops using AJAX to adding product to cart.

    Because after click on the button, woocommerce add class .disabled to button, and then IF statement rule will be FALSE, and script send dataLayer not fire.

    I test this on shop page created with Bricks Builder, and add_to_cart event not trigger on product page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.