WordPress filter hook
woocommerce_order_get_tax_location
Defined by WooCommerce and fired by 6 plugins in total, running on 7.5M+ sites between them.
“Filters the location an order is taxed at. A WooCommerce core filter, applied here as WC_Abstract_Order::get_tax_location() applies it.”
How to use woocommerce_order_get_tax_location
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_order_get_tax_location', function( $args, $object ) {
// Change $args here.
return $args;
}, 10, 2 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
6 plugins that fire woocommerce_order_get_tax_location
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_order_get_tax_location', $args, $this )includes/abstracts/abstract-wc-order.php:2427 -
WooCommerce Tax (formerly WooCommerce Shipping & Tax)500,000+ installs
apply_filters( 'woocommerce_order_get_tax_location', $location, $order )classes/class-wc-connect-taxjar-integration.php:5408 -
ePay Payment Solutions100+ installs
apply_filters( 'woocommerce_order_get_tax_location', $location, $order )epay-payment.php:2660 -
Saga Payments for WooCommerce20+ installs
apply_filters( 'woocommerce_order_get_tax_location', $at, $order )includes/saga-checkout/class-saga-checkout.php:1086 -
Voucherify10+ installs
apply_filters( 'woocommerce_order_get_tax_location', $args, $this )src/Voucherify/Wordpress/Discounts/DiscountsOrder.php:84 -
WPHEKA Edit & Cancel Orders for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_order_get_tax_location', $args, $order )includes/engine/class-edit-orders-for-woocommerce-address-change.php:472
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.