• Resolved chrisElkin

    (@chriselkin)


    Notice: WC_Customer::set_country is deprecated since version 3.0! Use WC_Customer::set_billing_country instead. in[domain]/wp-includes/functions.php on line 3839

    How do i fix this error?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Some plugin or theme uses deprecated method set_country from WC_Customer class.

    Thread Starter chrisElkin

    (@chriselkin)

    SO how do i fix this issue?

    Search for set_country in your plugins and theme code and replace it with set_billing_country

    Thread Starter chrisElkin

    (@chriselkin)

    function set_country( $country ) {
    wc_deprecated_function( ‘WC_Customer::set_country’, ‘3.0’, ‘WC_Customer::set_billing_country’ );
    $this->set_billing_country( $country );
    }

    Thread Starter chrisElkin

    (@chriselkin)

    new code:

    function set_billing_country( $country ) {
    wc_deprecated_function( ‘WC_Customer::set_country’, ‘3.0’, ‘WC_Customer::set_billing_country’ );
    $this->set_billing_country( $country );
    }

    Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    @chriselkin,

    If this is a plugin you wrote yourself, then you can update the code as you see fit. If this is a commercial or even a free plugin, you need to reach out to the developer and have them update the plugin and push out a new version

    This is merely a notice and not an error, the plugin will still do what it needs to do but if left without an update the functionality will break when the deprecated method is removed from WooCommerce.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Deprecated Notice – Line 3839’ is closed to new replies.