• Resolved kilbot

    (@kilbot)


    The WooCommerce function wc_get_product can return WC_Product|null|false. You have to be careful in your code to account for the null or false case – you can’t assume you have a product.

    For example, in your ga.php file, you have:

    $product = wc_get_product( $product_id );
    if (GATags()->getOption('woo_variable_as_simple') && $product->is_type('variation')) {
    $product = wc_get_product($product->get_parent_id());
    }
    if(!$product) continue;

    You need to check that $product is an actual product before you use $product->is_type('variation').

    Your plugin is currently breaking the checkout on several sites. Please check your code and update as soon as possible.

    • This topic was modified 1 year ago by kilbot.
    • This topic was modified 1 year ago by kilbot.
Viewing 1 replies (of 1 total)
  • Plugin Support pixelyoursitesupport

    (@pixelyoursitesupport)

    Hello @kilbot, thank you for bringing that to our attention. We’ve resolved the issue and released an update. Please update the plugin to version 11.0.0.

Viewing 1 replies (of 1 total)

The topic ‘Call to member function is_type() on bool’ is closed to new replies.