• Resolved lanasphoto

    (@lanasphoto)


    Backstory first.. My original problem was the descripion of my product refusing to load, the page would just stop loading at the headline of “Description”. I posted here (https://wordpress.org/support/topic/desciption-wont-show/) and was told to turn on debug which showed I had 4 “depreciated errors” and I was able to fix the first error “$product->ID”.

    Then I moved onto: “Notice: WC_Product::get_related is deprecated since version 3.0! Use wc_get_related_products instead. in /home2/*****/public_html/*****domain***/wp-includes/functions.php on line 3839″
    Changing get_related to wc_get_related_products is related.php triggered this error:

    Fatal error: Uncaught Error: Call to undefined method WC_Product_Variable::wc_get_related_products() in /home2/******/public_html/****domain**/wp-content/themes/kameleon/woocommerce/single-product/related.php:20 Stack trace: #0 /home2/******/public_html/****domain*/wp-content/plugins/woocommerce/includes/wc-core-functions.php(209): include() #1 /home2/****/public_html/****domain**/wp-content/plugins/woocommerce/includes/wc-template-functions.php(1370): wc_get_template(‘single-product/…’, Array) #2 /home2/*******/public_html/***domain***/wp-content/plugins/woocommerce/includes/wc-template-functions.php(1333): woocommerce_related_products(Array) #3 /home2/*****/public_html/****domain****/wp-includes/class-wp-hook.php(286): woocommerce_output_related_products(”) #4 /home2/*******/public_html/****domain****/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /home2/*******/public_html/**domain**/wp-includes/plugin.php(453): WP_Hook->do_act in /home2/******/public_html/***domain***/wp-content/themes/kameleon/woocommerce/single-product/related.php on line 20

    BUT.. this error allowed the bottom of my page to finally load. Restoring wc_get_related_products back to the depreciated get_products forces the 3 remaining errors (below) to be displayed on the page and my “Description” disapears again. How do I get rid of this fatal error and keep my description?

    Notice: WC_Product::get_categories is deprecated since version 3.0! Use wc_get_product_category_list instead. in /home2/******/public_html/***domain***/wp-includes/functions.php on line 3839

    Notice: WC_Product::get_tags is deprecated since version 3.0! Use wc_get_product_tag_list instead. in /home2/******/public_html/***domain**/wp-includes/functions.php on line 3839

    Notice: WC_Product::get_related is deprecated since version 3.0! Use wc_get_related_products instead. in /home2/*******/public_html/**********/wp-includes/functions.php on line 3839

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dustin Hartzler

    (@dustinhartzler)

    Automattic Happiness Engineer

    You’ll need to change out the deprecated functions from your WooCommerce template files in your child theme.

    Thread Starter lanasphoto

    (@lanasphoto)

    That’s what I was doing when it triggered the error. But nevermind I just removed the tab sections and will put the information I needed, elsewere.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get_related repair triggers fatal error.. and fixes a problem’ is closed to new replies.