It's because of the following code, the error was being thrown.
/plugins/backinstocknotifier/backinstocknotifier.php
$product = wc_get_product($post_id); if($product->get_type() == 'variable') { // the rest of the code }
It doesn't check the post is the product or not, so when the post is not the product, the plugin will throw error.
So we can correct the code such as,
$product = wc_get_product($post_id); if(isset($product) && $product === false){return;} // exit the function if the post_id not corresponding to product if($product->get_type() == 'variable') { // the rest of the code }
Top comments (0)