WC_Abstract_Legacy_Order::set_address( array $address, string $type = 'billing' )

Set the customer address.


Description Description


Parameters Parameters

$address

(Required) Address data.

$type

(Optional) billing or shipping.

Default value: 'billing'


Top ↑

Source Source

File: includes/legacy/abstract-wc-legacy-order.php

	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 );
			}
		}
	}

Top ↑

User Contributed Notes User Contributed Notes

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