gtm4wp_productdata broken
-
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!!!
- The topic ‘gtm4wp_productdata broken’ is closed to new replies.