Home Forums WoodMart support forum Add to Cart event sends all products to DataLayer instead of selected product

Add to Cart event sends all products to DataLayer instead of selected product

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #664230

    alefefbt
    Participant

    Hello,

    I’m experiencing an issue with the Woodmart theme and Google Tag Manager integration.

    When a customer clicks the “Add to Cart” button, the add_to_cart event is pushed to the dataLayer — but instead of sending only the selected product, the dataLayer sends all products from the store.

    Example from dataLayer:
    {
    event: “add_to_cart”,
    ecommerce: {
    currency: “BRL”,
    value: 94,
    items: [ /* contains all products instead of just the one added */ ]
    }
    }
    I confirmed the issue is related to the theme by switching to the default Hello Elementor theme. In that case, the event works perfectly and sends only the selected product to the dataLayer.

    I also tried:

    Disabling the “Track e-commerce” option in the GTM4WP plugin;
    Adding a manual dataLayer.push in PHP;
    Clearing caches and testing in incognito mode;
    Making sure only one product is actually added via Ajax;

    Unfortunately, the problem only happens when the Woodmart theme is active, which suggests a conflict in the theme’s Ajax cart or JS that populates the dataLayer.

    Can you help me find a solution or identify where the theme might be interfering with the correct dataLayer output for add-to-cart events?

    Thank you!

    #664344

    Hung Pham
    Keymaster

    Hi alefefbt,

    Thanks for reaching to us.

    Could you please record a short video and describe how we can reproduce the issue on your website so we can check this for you?

    Regards,
    Hung PD

Viewing 2 posts - 1 through 2 (of 2 total)