WC_Abstract_Legacy_Order::set_address()publicWC 1.0

Set the customer address.

Method of the class: WC_Abstract_Legacy_Order{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Abstract_Legacy_Order = new WC_Abstract_Legacy_Order();
$WC_Abstract_Legacy_Order->set_address( $address, $type );
$address(array) (required)
Address data.
$type(string)
Type of address; 'billing' or 'shipping'.
Default: 'billing'

WC_Abstract_Legacy_Order::set_address() code WC 9.3.1

public function set_address( $address, $type = 'billing' ) {
	foreach ( $address as $key => $value ) {
		update_post_meta( $this->get_id(), "_{$type}_" . $key, $value );
		if ( is_callable( array( $this, "set_{$type}_{$key}" ) ) ) {
			$this->{"set_{$type}_{$key}"}( $value );
		}
	}
}