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.
Использование
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
- -
Где вызывается хук
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 1120
} elseif ( $tax_rates !== $base_tax_rates && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
woocommerce/src/StoreApi/Utilities/ProductQuery.php 523
$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.php 1488
$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 383
$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 1105
$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 1168
if ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
woocommerce/includes/class-wc-cart-totals.php 427
if ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
woocommerce/includes/class-wc-cart-totals.php 722
$adjust_non_base_location_prices = apply_filters( 'woocommerce_adjust_non_base_location_prices', true );