Get_product function is deprecated since v3.0. Replace with wc_get_product

This topic has 13 replies, 3 voices, and was last updated 6 years, 11 months ago ago by Olga Barlow

  • Avatar: cdixonsu
    cdixonsu
    Participant
    April 28, 2017 at 19:57

    I am getting the following error whenever I try to access the Products link in the admin area of my website:

    The get_product function is deprecated since version 3.0. Replace with wc_get_product.

    I just updated to the latest version of the theme. Is this a theme error. How do I fix?

    Thanks

    12 Answers
    Avatar: cdixonsu
    cdixonsu
    Participant
    April 28, 2017 at 19:58

    It is actually a 500 error I see when I click on Products. The deprecated function message I found in the error log.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 3, 2017 at 13:00

    Hello,

    Thank you for using our theme!
    Please provide us with wp-admin and FTP credentials in private content area.

    Regards,
    Rose Tyler.

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 3, 2017 at 16:08

    Surely you can troubleshoot this issue without full access to my site… Please research this on your end.

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 3, 2017 at 19:11

    I’ve seen several replies to posts with the same thing, to provide login credentials. Everything doesn’t require you to access people’s website. Please stop stalling and fix our issues please.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 4, 2017 at 08:06

    Hello,

    Please provide the link to your site, we need it to check the problem.

    Regards,
    Rose Tyler.

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 4, 2017 at 09:01

    added to private content on this post. Thanks

    Please, contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 4, 2017 at 12:57

    Hello,

    Please try to disable 3-rd party plugins (means the plugins that are not included in the theme package are not in the list of required plugins) and check your issues.
    Also, provide a link to the page with the error and temporary wp-admin credentials in private content, because we haven’t this error on our side.

    Regards,
    Rose Tyler.

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 4, 2017 at 15:50

    I have tried disabling plugins. Every time I enable theme related plugins, I get this error. Essential Grid, Ultimate Addons for Visual Composer, Visual Composer, etc. Jetpack even has to be disabled in order for the Products page to work.

    The error is when I try to access /wp-admin/edit.php?post_type=product

    I get a 500 error on that page, and when I check the error log, this is the error: The get_product function is deprecated since version 3.0. Replace with wc_get_product.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 5, 2017 at 13:37

    Hello,

    New version theme does not have get_product function.
    We need your accesses to check the problem.

    Regards,
    Rose Tyler.

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 6, 2017 at 03:18

    Ok, I increased the memory limit and I can now get to the Admin Products page without error. Sorry for the confusion.

    I have another error I am getting now though:

    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

    Avatar: cdixonsu
    cdixonsu
    Participant
    May 6, 2017 at 03:20

    Sorry, I will submit a new thread on the forum for the new issue.

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

    Hello,

    Ok. Thanks.

    Regards

  • Viewing 13 results - 1 through 13 (of 13 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.