问题
I'm having this notice with all products on shop page after updating WooCommerce version to 3.0.
Notice: product_type was called incorrectly . Product properties should not be accessed directly. Please see Debugging in WordPress for more information. (This message was added in version 3.0.) in C:\xampp\htdocs\oye\wp-includes\functions.php on line 4137
any idea how to fix it?
回答1:
The product_type property is deprecated. Use get_type() to get internal type.
So you need to change this:
$product->product_type;
to this:
$product->get_type();
回答2:
(in functions.php) tried editing the "Select Options" text in WooCommerce and it gave that error.
Rafawhs answer worked for me too. This: $product->get_type();
来源:https://stackoverflow.com/questions/43374133/woocommerce-notice-product-type-was-called-incorrectly-product-properties-shou