• Resolved websharx

    (@websharx)


    Hi there,

    We keep getting internal server errors and are thinking it’s because this keeps showing up in our server logs:

    The WC_Customer::get_country function is deprecated since version 3.0. Replace with WC_Customer::get_billing_country.

    Can you please advise what needs to be done?

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hi @websharx, thanks for raising this, I’ll look at the codebase now and see what I can find out about that change.

    I’ve done a check of the Plugin codebase and neither direct functions or methods are in use. The closest related calls are:

    – WC()->countries->get_shipping_countries()
    – WC()->countries->get_allowed_countries()

    What version of WooCommerce are you using and WCM? Can you de-activate other Plugins except WooCommerce and WCM to see if this deprecation notice persists?

    Thread Starter websharx

    (@websharx)

    Hi Michael,

    Can you please email me (my email is bsaral@websharx.ca)? I keep getting the error. What’s happening is an internal server error on the checkout page.

    Here is our booking form: https://www.homeworkhelpglobal.com/ca/product/order-now-canada/

    Sometimes there’s an internal server error and sometimes there isn’t.

    Baljot

    • This reply was modified 8 years, 1 month ago by websharx.
    Thread Starter websharx

    (@websharx)

    Hi @visser,

    What we’re noticing now is when you go to checkout, it gives an internal server at the top just above the checkout. Then you have to checkout again to complete the order. Why’s this happening? We never had this issue before.

    What version of WooCommerce are you using and WCM? Can you de-activate other Plugins except WooCommerce and WCM to see if this deprecation notice persists?

    Can you also have a look at the WooCommerce > System Status > Logs > fatal-errors… file and paste the contents (sanitized), alternatively you can turn on WP_DEBUG_LOGGING within the wp-config.php file to catch fatal errors.

    Thread Starter websharx

    (@websharx)

    Here is what’s happening through debugging:

    Notice: WC_Customer::get_country is deprecated since version 3.0! Use WC_Customer::get_billing_country instead. in /home/hhelpglobal/public_html/staging/wp-includes/functions.php on line 3839

    We’re using the newest versions of WooCommerce (3.3.3) and WCM (4.1.7)

    Thread Starter websharx

    (@websharx)

    Hi @visser,

    Looks like it was instead happening from a MailChimp for WooCommerce plugin. Sorry for the hassle!!

    Baljot

    Hi @websharx, glad you narrowed it down. Let them know what’s going on 🙂

    Thread Starter websharx

    (@websharx)

    Hi @visser,

    Looks like I spoke too soon. We keep getting internal server errors. Can you please email us at bsaral@websharx.ca?

    We keep getting this error:

    The WC_Customer::get_country function is deprecated since version 3.0. Replace with WC_Customer::get_billing_country.

    Hi @websharx, I don’t offer e-mail support via w.org

    What version of WooCommerce are you using and WCM?

    Can you also have a look at the WooCommerce > System Status > Logs > fatal-errors… file and paste the contents (sanitized), alternatively you can turn on WP_DEBUG_LOGGING within the wp-config.php file to catch fatal errors and paste them here.

    Thread Starter websharx

    (@websharx)

    Hi @visser,

    No problem definitely understand. Please see the errors below:

    2018-02-20T18:08:50+00:00 CRITICAL Cannot declare class PUM_ATB, because the name is already in use

    2018-02-20T18:10:05+00:00 CRITICAL Cannot declare class PUM_ATB, because the name is already in use

    2018-02-20T18:10:19+00:00 CRITICAL Cannot declare class PUM_ATB, because the name is already in use

    2018-02-21T12:34:05+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:14:00+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:14:30+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:16:31+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:18:30+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:20:12+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:20:13+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:20:38+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:22:37+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:44:13+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:46:11+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:47:43+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:49:43+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-21T20:56:41+00:00 CRITICAL Uncaught Error: Call to a member function is_type() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:812
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-coupons.php(117): WC_Coupon->is_valid_for_product(false, Array)
    #1 /home/hhelpglobal/public_html/wp-includes/class-wp-hook.php(286): WCML_Coupons->is_valid_for_product(true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #2 /home/hhelpglobal/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(845): apply_filters(‘woocommerce_cou…’, true, Object(WC_Product_Simple), Object(WC_Coupon), Array)
    #4 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(752): WC_Coupon->is_valid_for_product(Object(WC_Product_Simple), Array)
    #5 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce/includes

    2018-02-25T02:31:04+00:00 CRITICAL Uncaught Error: Call to a member function get_sku() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics-js.php:400
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics-js.php(337): WC_Google_Analytics_JS->add_item_universal(Object(WC_Order), Object(WC_Order_Item_Product))
    #1 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics-js.php(284): WC_Google_Analytics_JS->add_transaction_universal(Object(WC_Order))
    #2 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics.php(327): WC_Google_Analytics_JS->add_transaction(Object(WC_Order))
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics.php(293): WC_Google_Analytics->get_ecommerc

    2018-02-25T02:31:41+00:00 CRITICAL Uncaught Error: Call to a member function get_sku() on boolean in /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics-js.php:400
    Stack trace:
    #0 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics-js.php(337): WC_Google_Analytics_JS->add_item_universal(Object(WC_Order), Object(WC_Order_Item_Product))
    #1 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics-js.php(284): WC_Google_Analytics_JS->add_transaction_universal(Object(WC_Order))
    #2 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics.php(327): WC_Google_Analytics_JS->add_transaction(Object(WC_Order))
    #3 /home/hhelpglobal/public_html/wp-content/plugins/woocommerce-google-analytics-integration/includes/class-wc-google-analytics.php(293): WC_Google_Analytics->get_ecommerc

    Thread Starter websharx

    (@websharx)

    Hi @visser,

    Would you have any update on this? We keep getting this error in the log:

    [28-Feb-2018 06:24:10 UTC] The WC_Customer::get_country function is deprecated since version 3.0. Replace with WC_Customer::get_billing_country.
    [28-

    zanzibarwinds

    (@zanzibarwinds)

    I am getting these errors also, any help would be appreciated.

    I am getting these errors in LiteBlue site, any help would be appreciated. Looking few more answers

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Get Country Function Error’ is closed to new replies.