WordPress at Your Fingertips
function is not described

WC_Tax::get_tax_location() public WC 1.0

Get the customer tax location based on their status and the current page.

Used by get_rates(), get_shipping_rates().

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

Hooks from the method

Return

Array.

Usage

$result = WC_Tax::get_tax_location( $tax_class, $customer );
$tax_class(string)
string Optional, passed to the filter for advanced tax setups.
Default: ''
$customer(object)
Override the customer object to get their location.
Default: null

Code of WC_Tax::get_tax_location() WC 5.9.0

public static function get_tax_location( $tax_class = '', $customer = null ) {
	$location = array();

	if ( is_null( $customer ) && WC()->customer ) {
		$customer = WC()->customer;
	}

	if ( ! empty( $customer ) ) {
		$location = $customer->get_taxable_address();
	} elseif ( wc_prices_include_tax() || 'base' === get_option( 'woocommerce_default_customer_address' ) || 'base' === get_option( 'woocommerce_tax_based_on' ) ) {
		$location = array(
			WC()->countries->get_base_country(),
			WC()->countries->get_base_state(),
			WC()->countries->get_base_postcode(),
			WC()->countries->get_base_city(),
		);
	}

	return apply_filters( 'woocommerce_get_tax_location', $location, $tax_class, $customer );
}