• Resolved denis24

    (@denis24)


    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]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Constant Contact

    (@constantcontact)

    Good day

    Thank you for reporting this. We have dug in to the code and the spots within WooCommerce’s code and verified that this looks to be legit.

    We will aim to get this cleaned up as soon as we can. It shouldn’t be causing any errors or degradation in plugin functionality, but we do try to keep error logs clean as well, whenever possible.

    Issues have been filed to take care of it.

    Thanks again.

    Plugin Author Constant Contact

    (@constantcontact)

    These were removed in the 2.1.1 release.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP error: Deprecated functions’ is closed to new replies.