Automattic\WooCommerce\StoreApi\Utilities

OrderController::get_shipping_location │ private static │ WC 1.0

Gets the location an order ships to.

An order with no shipping address, e.g. one created in the admin, ships to its billing address. WC_Abstract_Order::get_tax_location() uses the same fallback.

Method of the class: OrderController{}

No Hooks.

Returns

array.

Usage

$result = OrderController::get_shipping_location( $order ): array;
$order(WC_Order) (required)
Order to read.

OrderController::get_shipping_location() code WC 11.3.0

private static function get_shipping_location( \WC_Order $order ): array {
	return $order->get_address( $order->get_shipping_country() ? 'shipping' : 'billing' );
}