Support » Fixing WordPress » Notice: deprecated, but cannot find deprecated function

  • Hi!
    I am getting errors such as:

    • Notice: WC_Customer::set_address is deprecated since version 3.0! Use WC_Customer::set_billing_address instead. in /home/u21143p18530/domains/unicrown.be/public_html/wp-includes/functions.php on line 3853
    • Notice: WC_Customer::set_city is deprecated since version 3.0! Use WC_Customer::set_billing_city instead. in /home/u21143p18530/domains/unicrown.be/public_html/wp-includes/functions.php on line 3853
    • Notice: WC_Customer::set_country is deprecated since version 3.0! Use WC_Customer::set_billing_country instead. in /home/u21143p18530/domains/unicrown.be/public_html/wp-includes/functions.php on line 3853

    However, i the functions.php I cannot find any mention of ‘set_address’, ‘set_city’ or ‘set_country’.
    After searching through the entire wp-includes and plugin folder, I only find mentions in the “plugins\woocommerce\includes\legacy\class-wc-legacy-customer.php”. I

    My questions:

    1. How can I solve this error if I can’t find where these functions are used?
    2. Is there a way to hide the notice, since the site is working fine?
    3. I am running the newest versions:
      WordPress 4.9.8
      StorefrontVersion: 2.3.5
      Woocommerce Version 3.5.1

      Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @lwitch,

    Looks like you have recently upgraded your WooCommerce plugin but you have not updated your theme as your theme has WooCommerce template files hosted in it, under following path

    /theme/woocommerce/

    So what exactly you will have to do,

    (IMPORTANT: Keep backup)

    1. If you are using a pre-made theme and purchased it, get an upgrade of your theme from the provider.

    2. If you have are developer, you need to download WooCommerce fresh plugin, and copy “template” directory’s content to your theme’s /theme/woocommerce/ directory and apply all your customisation again

    3. Go to this directory, /theme/woocommerce/ and update the lines by searching those deprecated functions names by search via files from IDE (code editor) and replace by the suggested names as you mentioned in your thread.

    Let me know if you are still questions, would love to help you more.

    šŸ™‚

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    šŸ³ļøā€šŸŒˆ Plugin Review Team Rep

    Please don’t post in the Alpha/Beta forum unless you’re actually testing the alpha/beta version of WordPress (not a plugin or a theme). Also, once WordPress has released a version, it’s not appropriate to post in alpha/beta and you should post in the How To & Troublshooting forum:

    https://wordpress.org/support/forum/how-to-and-troubleshooting

    This post has been moved out for you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Notice: deprecated, but cannot find deprecated function’ is closed to new replies.