Home woocommerce notice product_type was called incorrectly . Product properties should not be accessed directly
Reply: 0

woocommerce notice product_type was called incorrectly . Product properties should not be accessed directly

user7257
1#
user7257 Published in September 19, 2018, 6:52 pm

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?

share|improve this question
  • 1
    This surely come from your custom code or from your active theme (also it can be a third party plugin involved in woocommerce). Version 3.0+ is a Mega Major version and a lot of allowed code is now deprecated. So you will have to test everithing. Also that new WooCommerce version have some bugs, just because it's a new release. You will better go backwards and wait some time. The best thing is to have a staging website for testing and debugging... – LoicTheAztec Apr 12 '17 at 17:03
  • Please try below answer stackoverflow.com/questions/43279193/… – Mujeebu Rahman Apr 12 '17 at 17:06
  • 1
    All Class Objects properties are not accessible anymore directly in WooCommerce 3.0+. you have to use the getter or setter methods instead. In your case you have to use $product with the WC_Product object get_type method this way: $product->get_type();... – LoicTheAztec Apr 12 '17 at 18:05

2 Answers 2

active oldest votes
up vote 10 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.495029 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO