• Resolved supportadtribes

    (@supportadtribes)


    When calling the add_to_cart function like this:

    if((is_numeric($product_id)) AND ($product_id > 0) AND (!empty($product_id))){
    WC()->cart->add_to_cart( $product_id, $quantity );
    }

    These errors show in the WooCommerce fatal error logs:

    2022-04-21T14:29:22+00:00 CRITICAL Uncaught Error: Call to a member function get_attributes() on bool in /var/www/xxx/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php:1045
    Stack trace:
    #0 /var/www/xxx/public_html/wp-content/plugins/woo-product-feed-elite/classes/class-get-products.php(828): WC_Cart->add_to_cart(0, 1)

    Do you have any idea why this is and how to prevent this as we made sure the product IS numeric and bigger than 0?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CRITICAL Uncaught Error’ is closed to new replies.