Notice: product_type was called incorrectly

This topic has 10 replies, 3 voices, and was last updated 6 years, 11 months ago ago by Rose Tyler

  • Avatar: cdixonsu
    cdixonsu
    Participant
    May 6, 2017 at 03:46

    Hello,

    I am getting the following when I enabled debug on my site:

    Notice: 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’), include(‘/themes/royal/woocommerce/single-product.php’), wc_get_template_part, load_template, require(‘/themes/royal/woocommerce/content-single-product.php’), previous_post_link_product, WC_Product->__construct, WC_Product->get_type, 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 /home1/reneema5/public_html/wp-includes/functions.php on line 4138

    Notice: Undefined property: WC_Product::$product_type in /home1/reneema5/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php on line 139

    Notice: 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’), include(‘/themes/royal/woocommerce/single-product.php’), wc_get_template_part, load_template, require(‘/themes/royal/woocommerce/content-single-product.php’), next_post_link_product, WC_Product->__construct, WC_Product->get_type, 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 /home1/reneema5/public_html/wp-includes/functions.php on line 4138

    Notice: Undefined property: WC_Product::$product_type in /home1/reneema5/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php on line 139

    Please, contact administrator
    for this information.
    9 Answers
    Avatar: cdixonsu
    cdixonsu
    Participant
    May 6, 2017 at 04:04

    Not sure if this one is theme related but…

    [06-May-2017 02:53:14 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 6, 2017 at 09:51

    Hello,

    Please, provide me temporary admin panel and FTP access to your site and link to page where we’ll be able to check the problem.

    Regards

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 9, 2017 at 02:58

    More errors. can you not re-create these on your end. It shows up when debug is set to true.

    Notice: 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’), include(‘/themes/royal/woocommerce/single-product.php’), get_header, locate_template, load_template, require_once(‘/themes/royal/header.php’), wp_head, do_action(‘wp_head’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, Webdados_FB_Public->insert_meta_tags, WC_Product->__construct, WC_Product->get_type, 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 4138

    Notice: Undefined property: WC_Product::$product_type in /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php on line 139

    Notice: 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’), include(‘/themes/royal/woocommerce/single-product.php’), wc_get_template_part, load_template, require(‘/themes/royal/woocommerce/content-single-product.php’), previous_post_link_product, WC_Product->__construct, WC_Product->get_type, 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 4138

    Notice: Undefined property: WC_Product::$product_type in /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php on line 139

    Notice: 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’), include(‘/themes/royal/woocommerce/single-product.php’), wc_get_template_part, load_template, require(‘/themes/royal/woocommerce/content-single-product.php’), next_post_link_product, WC_Product->__construct, WC_Product->get_type, 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 4138

    Notice: Undefined property: WC_Product::$product_type in /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php on line 139

    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(‘/themes/royal/woocommerce/single-product.php’), wc_get_template_part, load_template, require(‘/themes/royal/woocommerce/content-single-product.php’), do_action(‘woocommerce_after_single_product_summary’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, woocommerce_output_product_data_tabs, wc_get_template, include(‘/themes/royal/woocommerce/single-product/tabs/tabs.php’), call_user_func, comments_template, require(‘/themes/royal/woocommerce/single-product-reviews.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 4138

    Strict Standards: Declaration of MH_Table_Rate_Plus_Shipping_Method::calculate_shipping() should be compatible with WC_Shipping_Method::calculate_shipping($package = Array) in /wp-content/plugins/mh-woocommerce-table-rate-shipping-plus/mh-wc-table-rate-plus.php on line 55

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 10, 2017 at 14:31

    Hello,

    Could you please provide wp-admin and FTP access in Private Content?

    Regards,
    Rose Tyler.

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 10, 2017 at 14:51

    Have you tried to see if you see these errors when debug is set to true on your test site???

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 10, 2017 at 14:57

    There are 6 occurrences of $product->ID in \royal\framework\woo.php (6 hits)

    There is 1 occurrence in \royal\woocommerce\single-product-reviews.php (1 hit)

    Is this supposed to be there or should it be get ID instead now???

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 10, 2017 at 14:58

    Hello,

    We do not have these errors on your test site.

    Regards,
    Rose Tyler.

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 10, 2017 at 15:05

    Should these be get ID instead?

    There are 6 occurrences of $product->ID in \royal\framework\woo.php

    There is 1 occurrence in \royal\woocommerce\single-product-reviews.php

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 11, 2017 at 13:28

    Hello,

    You can change $product->ID to $product->get_id()

    Regards,
    Rose Tyler.

  • Viewing 10 results - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.