WC_Customer::set_shipping_location()
Sets all shipping info at once.
Метод класса: WC_Customer{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WC_Customer = new WC_Customer(); $WC_Customer->set_shipping_location( $country, $state, $postcode, $city );
- $country(строка) (обязательный)
- Country.
- $state(строка)
- State.
По умолчанию: '' - $postcode(строка)
- Postcode.
По умолчанию: '' - $city(строка)
- City.
По умолчанию: ''
Код WC_Customer::set_shipping_location() WC Customer::set shipping location WC 9.8.2
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 ); }