Error message in log when adding items to basket

My site is working ok and woocommerce too. However, I notice the error log is filling up with Woocommerce errors. I’ve narrowed it down to when you add an item to your shopping basket. Here are the entries created when adding a single item to the basket and the page refreshes -

[27-Jul-2017 13:06:54 UTC] id was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::get_refreshed_fragments, woocommerce_mini_cart, wc_get_template, include(’/plugins/woocommerce/templates/cart/mini-cart.php’), apply_filters(‘woocommerce_cart_item_product’), WP_Hook->apply_filters, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.
[27-Jul-2017 13:06:54 UTC] post was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::get_refreshed_fragments, woocommerce_mini_cart, wc_get_template, include(’/plugins/woocommerce/templates/cart/mini-cart.php’), apply_filters(‘woocommerce_cart_item_product’), WP_Hook->apply_filters, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.
[27-Jul-2017 13:06:54 UTC] product_type was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::get_refreshed_fragments, woocommerce_mini_cart, wc_get_template, include(’/plugins/woocommerce/templates/cart/mini-cart.php’), apply_filters(‘woocommerce_cart_item_product’), WP_Hook->apply_filters, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.
[27-Jul-2017 13:06:54 UTC] id was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::get_refreshed_fragments, woocommerce_mini_cart, wc_get_template, include(’/plugins/woocommerce/templates/cart/mini-cart.php’), apply_filters(‘woocommerce_cart_item_product’), WP_Hook->apply_filters, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.
[27-Jul-2017 13:06:54 UTC] post was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::get_refreshed_fragments, woocommerce_mini_cart, wc_get_template, include(’/plugins/woocommerce/templates/cart/mini-cart.php’), apply_filters(‘woocommerce_cart_item_product’), WP_Hook->apply_filters, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.
[27-Jul-2017 13:06:54 UTC] product_type was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::get_refreshed_fragments, woocommerce_mini_cart, wc_get_template, include(’/plugins/woocommerce/templates/cart/mini-cart.php’), apply_filters(‘woocommerce_cart_item_product’), WP_Hook->apply_filters, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.

Is there currently an issue with the way the Ajax performs the adding to the cart?

Hi there,

Thanks for writing in.

It looks like a notice/warning than an error. And it’s usually logged if your debugging is turned on or your hosting prefer to logs all warning/notices.

In Wordpress, you can toggle off debugging in your site’s wp-config.php by setting WP_DEBUG to false.

Would you mind providing your admin and FTP login credentials in a secure note? I’d like to check it too in case it’s not due to WP_DEBUG.

Thanks!

Apologies for the delay in replying - I didn’t this forum doesn’t send notifications on replies. I’ve checked the debug settings and it’s on false at the moment. I will add some FTP credentials to this reply.

Hi there,

Thank you for providing the information. As I checked the case it is indeed turned off in WP_Debug.

Would you please kindly change the theme from X to another one and see if the problem is there again. If no then this seems to be related to the Woocommerce installation itself and it needs to be followed up with Woocommerce support:

Thank you for your understanding.

Thank you for the reply. It prompted me to look at the plugins I’d got installed. I noticed gtm4wp mentioned in the errors, so I tried turning off the Google Tag Manager plugin and the problem goes away. And sure enough, when I re-enable it, the problem returns, so I’ve mentioned it on that plugin’s forum.

Thanks for looking into it and apologies for wasting your time :slight_smile:

Hi there,

Glad that you’ve managed to find the culprit. This is not a waste of time at all, this information will be valuable for our other customers that may have the same issue.

Thank you for your contribution.