• Hi. Code in gtm4wp_woocommerce_enhanced_ecom_product_click (integration/woocommerce.php line 557 and onwards) is incorrect, causing JS error and GMT event to not be raised. Details:

    1. See line #562:
    var _productdata = $( this ).closest( '.product' ).length;

    _productdata var holds the count (int) of the available products. This is then used in line #563 to determine if any product info is available, which is of course good.

    BUT

    2. See line #564:
    var productdata = _productdata.find( '.gtm4wp_productdata' );
    You are trying to call a ‘find’ method on an INTEGER!

    This is really easy to resolve. Simply current code (lines 562-563) which is:

    
    var _productdata = $( this ).closest( '.product' ).length;
    if ( _productdata > 0 ) {
    

    Needs to be replaced with:

    
    var _productdata = $( this ).closest( '.product' );     
    if ( _productdata.length > 0 ) {
    

    Any chance this can be done in a quick plugin update?

    THANKS!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is an interesting post. How do you see and recreate the error?

    Any news on this issue?

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    This fix has been added to the development version.
    The next plugin version release is scheduled to next week so hopefully you can start using it soon.

    Thanks,
    Thomas Geiger

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘gtm4wp_productdata broken’ is closed to new replies.