Fatal error with WooCommerce
-
Hi
We are on WooCommerce v2.4.x and found that a site completely stopped working due to a PHP fatal error relating to the plugin
PHP Fatal error: Call to undefined method WC_Product_Variable::get_id()
After digging through the plugin code this appears to be due to lines like the following:
if (version_compare($woocommerce->version, "2.4", "<=")) { category = get_the_terms($product->Id, "product_cat"); } else { $category = get_the_terms($product->get_id(), "product_cat"); }
When this function was added after 2.6:
https://docs.woocommerce.com/wc-apidocs/source-class-WC_Data.html#144-152
Replacing 2.4 with 2.6 fixed the problem.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Fatal error with WooCommerce’ is closed to new replies.