woocommerce_adjust_non_base_location_prices
The woocommerce_adjust_non_base_location_prices filter can stop base taxes being taken off when dealing with out of base locations.
- e.g. If a product costs 10 including tax, all users will pay 10 regardless of location and taxes.
- This feature is experimental @since 2.4.7 and may change in the future. Use at your risk.
Usage
add_filter( 'woocommerce_adjust_non_base_location_prices', 'wp_kama_woocommerce_adjust_non_base_location_prices_filter' );
/**
* Function for `woocommerce_adjust_non_base_location_prices` filter-hook.
*
* @param $true
*
* @return
*/
function wp_kama_woocommerce_adjust_non_base_location_prices_filter( $true ){
// filter...
return $true;
}
- $true
- -
Where the hook is called
woocommerce_adjust_non_base_location_prices
woocommerce_adjust_non_base_location_prices
woocommerce_adjust_non_base_location_prices
woocommerce_adjust_non_base_location_prices
woocommerce_adjust_non_base_location_prices
woocommerce_adjust_non_base_location_prices
woocommerce_adjust_non_base_location_prices
woocommerce_adjust_non_base_location_prices
woocommerce_adjust_non_base_location_prices
woocommerce/includes/wc-product-functions.php 1519
} elseif ( $tax_rates !== $base_tax_rates && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
woocommerce/src/Internal/ProductFilters/QueryClauses.php 540
$taxes = apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ? WC_Tax::calc_tax( $price_filter, $base_tax_rates, true ) : WC_Tax::calc_tax( $price_filter, $tax_rates, true );
woocommerce/src/StoreApi/Utilities/ProductQuery.php 579
$taxes = apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ? WC_Tax::calc_tax( $price_filter, $base_tax_rates, true ) : WC_Tax::calc_tax( $price_filter, $tax_rates, true );
woocommerce/src/Blocks/BlockTypes/ProductCollection/QueryBuilder.php 995
$taxes = apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ? WC_Tax::calc_tax( $price_filter, $base_tax_rates, true ) : WC_Tax::calc_tax( $price_filter, $tax_rates, true );
woocommerce/src/Blocks/QueryFilters.php 385
$taxes = apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ? WC_Tax::calc_tax( $price_filter, $base_tax_rates, true ) : WC_Tax::calc_tax( $price_filter, $tax_rates, true );
woocommerce/includes/wc-product-functions.php 1504
$remove_taxes = apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ? WC_Tax::calc_tax( $line_price, $base_tax_rates, true ) : WC_Tax::calc_tax( $line_price, $tax_rates, true );
woocommerce/includes/wc-product-functions.php 1573
if ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
woocommerce/includes/admin/settings/class-wc-settings-tax.php 406
if ( ! apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
woocommerce/includes/class-wc-cart-totals.php 423
if ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
woocommerce/includes/class-wc-cart-totals.php 720
$adjust_non_base_location_prices = apply_filters( 'woocommerce_adjust_non_base_location_prices', true );