string(2) "id"
Notice: id was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/plugins/woocommerce/templates/single-product.php’), wc_get_template_part, load_template, require(‘/plugins/woocommerce/templates/content-single-product.php’), do_action(‘woocommerce_after_single_product_summary’), WP_Hook->do_action, WP_Hook->apply_filters, Avada_Woocommerce->output_related_products, woocommerce_related_products, wc_get_template, include(‘/themes/demo-theme/woocommerce/single-product/related.php’), WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please see Debugging in WordPress for more information. (This message was added in version 3.0.) in /wp-includes/functions.php on line 5227
Question posted in Woocommerce
The official Woocommerce documentation can be found here.
The official Woocommerce documentation can be found here.
2
Answers
This is probabily caused by an old file in yout template while you have a new Woocommerce version. The fix is quite easy, just look for the file "/themes/demo-theme/woocommerce/single-product/related.php" as described in the stack trace and replace:
with:
That should be done for all the occurrences of "$product->id;" in order to get rid of the warning