WordPress at Your Fingertips
function is not described

WC_Customer::set_shipping_location() public WC 1.0

Sets all shipping info at once.

{} It's a method of the class: WC_Customer{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Customer = new WC_Customer();
$WC_Customer->set_shipping_location( $country, $state, $postcode, $city );
$country(string) (required)
Country.
$state(string)
State.
Default: ''
$postcode(string)
Postcode.
Default: ''
$city(string)
City.
Default: ''

Code of WC_Customer::set_shipping_location() WC 5.9.0

public function set_shipping_location( $country, $state = '', $postcode = '', $city = '' ) {
	$address_data = $this->get_prop( 'shipping', '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( 'shipping', $address_data );
}