CRITICAL Uncaught Error
-
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?
The topic ‘CRITICAL Uncaught Error’ is closed to new replies.