WC_Customer::set_billing_location( string $country, string $state = '', string $postcode = '', string $city = '' )

Sets all address info at once.


Description Description


Parameters Parameters

$country

(Required) Country.

$state

(Optional) State.

Default value: ''

$postcode

(Optional) Postcode.

Default value: ''

$city

(Optional) City.

Default value: ''


Top ↑

Source Source

File: includes/class-wc-customer.php

	public function set_billing_location( $country, $state = '', $postcode = '', $city = '' ) {
		$address_data = $this->get_prop( 'billing', 'edit' );

		$address_data['address_1'] = '';
		$address_data['address_2'] = '';
		$address_data['city']      = $city;
		$address_data['state']     = $state;
		$address_data['postcode']  = $postcode;
		$address_data['country']   = $country;

		$this->set_prop( 'billing', $address_data );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.