• Warning Fixes should be done in /plugins/duracelltomi-google-tag-manager/integration/woocommerce.php

    Warning: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, call_user_func_array, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, 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, call_user_func_array, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.

    Fix: $product->id should be replaced with $product->get_id()

    Warning: 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, call_user_func_array, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, 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, call_user_func_array, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.

    Fix: Wherever we have code: $product->post->post_title; we should add $post_title = get_the_title($product_id); above this code $product->post->post_title should be changed to $post_title

    Warning: 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, call_user_func_array, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_get_refreshed_fragments’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, 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, call_user_func_array, gtm4wp_woocommerce_cart_item_product_filter, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.

    Fix:$product->product_type should be replaced with $product->get_type()

  • The topic ‘Warning fixes’ is closed to new replies.