• Hello,

    I have an error:
    Fatal error: Uncaught Error: Call to a member function is_type() on false in /wp-content/plugins/google-site-kit/includes/Core/Conversion_Tracking/Conversion_Event_Providers/WooCommerce.php:256

    Please check if $product is really a product before using $product->is_type( ‘variation’ ).

    Thanks,
    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Adam Dunnage

    (@adamdunnage)

    Hello @maxplateau, thanks for getting in touch and for sharing the fatal error you’re seeing. I’d be happy to look deeper into this for you from a Site Kit perspective. To do this, please can you first share the following information:

    1. Your Site Health information. You can use this form to share privately if preferred.
    2. At what stage do you encounter this? For example is this when navigating to the Site Kit dashboard?
    3. Does the same error display when following the troubleshooting steps here and in troubleshooting mode with just Site Kit and WooCommerce active?

    Once you have shared this information, I can review to get a better idea of what may be happening. I will then ask for further information or suggest some next steps for you to take.

    Thread Starter maxplateau

    (@maxplateau)

    My issue is the same as this one here:
    https://github.com/google/site-kit-wp/issues/11049

    To fix the issue, I have added this code at the top of get_formatted_product() function:
    $product = wc_get_product( $product );
    if ( ! $product || ! $product instanceof WC_Product ) { return array(); }




    Plugin Support Adam Dunnage

    (@adamdunnage)

    @maxplateau Thanks for clarifying this and thanks for sharing your fix for the issue. You can continue to follow the GitHub issue for updates but in the meantime, is there anything else we can help you with?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘get_formatted_product() Error’ is closed to new replies.