• We’ve got a lot of Uncaught Error on a quite large amount of product pages since a few weeks (wordpress, woocommerce and pixelsite plugins are all up to date).

    It looks like you’re accessing a property of a Product object, but you don’t make sure it’s actually a Product object beforehand. wc_get_product() may return false or null.

    // functions-woo.php:L64
    $variation_id = key($prices['price']); // Получаем ID вариации
    $variation = wc_get_product($variation_id); // Создаем экземпляр вариации

    $args = array(
    'price' => $variation->get_price(),
    'qty' => 1
    );

    Uncaught Error: Call to a member function get_price() on bool in /home/xxx/public_html/wp-content/plugins/pixelyoursite/includes/functions-woo.php:68 CONTEXT: {"error":{"type":1,"file":"\/home\/xxx\/public_html\/wp-content\/plugins\/pixelyoursite\/includes\/functions-woo.php","line":68},"backtrace":[...]}

  • The topic ‘Uncaught Error: Call to a member function get_price() on bool’ is closed to new replies.