PHP error: Deprecated functions
-
When Constant Contact + WooCommerce plugin is activated, I get these PHP errors:
[27-Apr-2023 19:30:07 UTC] The WC_Customer::get_address_2 function is deprecated since version 3.0. Replace with WC_Customer::get_billing_address_2.
[27-Apr-2023 19:30:07 UTC] The WC_Customer::get_city function is deprecated since version 3.0. Replace with WC_Customer::get_billing_city.
[27-Apr-2023 19:30:07 UTC] The WC_Customer::get_country function is deprecated since version 3.0. Replace with WC_Customer::get_billing_country.
[27-Apr-2023 19:30:07 UTC] The WC_Customer::get_postcode function is deprecated since version 3.0. Replace with WC_Customer::get_billing_postcode.
[27-Apr-2023 19:30:07 UTC] The WC_Customer::get_state function is deprecated since version 3.0. Replace with WC_Customer::get_billing_state.These errors appear even if I deactivate all other plugins except WordFence, and switch to Twenty Twenty Two theme.
The errors do NOT appear if all plugins are activated EXCEPT Constant Contact + WooCommerce, and my child theme of Flatsome is active.
Investigating your plugin, I found this file: CheckoutHandler.php
I commented out several lines in this function:/** * Return array of address fields we want. * * @author Michael Beckwith <[email protected]> * @since 2.1.0 */ protected function get_the_address_fields() { return [ // 'address_1', // 'address_2', // 'city', // 'country', // 'postcode', // 'state', 'shipping_address_1', 'shipping_address_2', 'shipping_city', 'shipping_country', 'shipping_postcode', 'shipping_state', 'billing_address_1', 'billing_address_2', 'billing_city', 'billing_country', 'billing_postcode', 'billing_state', 'billing_phone', 'billing_email', ]; }
Now the errors no longer appear.
Please fix this!
The page I need help with: [log in to see the link]
- The topic ‘PHP error: Deprecated functions’ is closed to new replies.