Code-Snippets-Functions/Execute a function on a child site/WooCommerce/set-customer-default-tax-location.txt

8 lines
318 B
Text

add_filter( 'woocommerce_get_tax_location', 'bbloomer_customer_default_tax_location', 9999, 3 );
function bbloomer_customer_default_tax_location( $location, $tax_class, $customer ) {
if ( $customer && ! $customer->get_billing_country() ) {
return array( 'US', '', '', '' );
}
return $location;
}