• Great plugin, does what it’s supposed to do. Took me a while to realise a thing like this isn’t in woocommerce itself and couldn’t find it on the woothemes site. But got you now, shy friend!

    But the main issue is:

    PHP message: PHP Fatal error:

    Call to a member function get_sku() on a non-object in /var/www/wordpress/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics-js.php on line 445

    This error makes the pages with a woocommerce product page attached via shortcode, drastically different ??

    A friend found the issue and added a line of code to this page (already included):

    /**
      * Tracks a product detail view
      */
     function product_detail( $product ) {
      if(!$product) { return; }
      wc_enqueue_js( "
       " . self::tracker_var() . "( 'ec:addProduct', {
        'id': '" . esc_js( $product->get_sku() ? $product->get_sku() : $product->id ) . "',
        'name': '" . esc_js( $product->get_title() ) . "',
        'category': " . self::product_get_category_line( $product ) . "
        'price': '" . esc_js( $product->get_price() ) . "',
       } );
    
       " . self::tracker_var() . "( 'ec:setAction', 'detail' );" );
     }

    Now the pages aren’t broken anymore, i think the tracking also still works on these pages.

    Any chance you can fix this for an update? Or do you reckon the pages on my site returning a ‘null’ on this request is the real source of the issue?

    One of the pages: https://hartbeach.nl/surfles-voor-volwassenen/

    Thanks!

    Bart

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Bug: conflict’ is closed to new replies.