Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sergioal

    (@sergioal)

    I think I fixed the problem, the way the add_to_cart_button function was being called didnt match the way woocommerce was laying out the products in the all products page, so in woocommerce.php I changed in line number 323 this:

    var productdata = $( this ).parent().find( 'a .gtm4wp_productdata' );

    for this:

    var productdata = $( this ).closest('li').find( 'a .gtm4wp_productdata' );

    It seems to be working fine now, see how we go,

    Cheers.

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Thanks for sharing.
    As I mentioned in the reply of your email I added the fix to the development version.

    Hi @duracelltomi

    Thanks for your plugin. I have just downloaded at installed this and I am having the same problem as above. Is the best way to fix this the solution above?

    Thanks

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Gary,

    This fix is already included in the latest release thus I would say some other issue could be the reason on your site.

    Thomas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘On Products list page, the add to cart fires the dataLayer as undefined’ is closed to new replies.