Add disclaimer to woocommerce_adjust_non_base_location_prices
This commit is contained in:
parent
4959937689
commit
0830543c4f
|
@ -827,6 +827,11 @@ class WC_Product {
|
||||||
$base_tax_amount = array_sum( $base_taxes );
|
$base_tax_amount = array_sum( $base_taxes );
|
||||||
$price = round( $price * $qty - $base_tax_amount, wc_get_price_decimals() );
|
$price = round( $price * $qty - $base_tax_amount, wc_get_price_decimals() );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
} elseif ( $tax_rates !== $base_tax_rates && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
} elseif ( $tax_rates !== $base_tax_rates && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
||||||
|
|
||||||
$base_taxes = WC_Tax::calc_tax( $price * $qty, $base_tax_rates, true );
|
$base_taxes = WC_Tax::calc_tax( $price * $qty, $base_tax_rates, true );
|
||||||
|
|
|
@ -1142,7 +1142,11 @@ class WC_Cart {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ADJUST TAX - Calculations when base tax is not equal to the item tax
|
* ADJUST TAX - Calculations when base tax is not equal to the item tax
|
||||||
*/
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
if ( $item_tax_rates !== $base_tax_rates && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
if ( $item_tax_rates !== $base_tax_rates && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
||||||
|
|
||||||
// Work out a new base price without the shop's base tax
|
// Work out a new base price without the shop's base tax
|
||||||
|
@ -1232,7 +1236,11 @@ class WC_Cart {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ADJUST TAX - Calculations when base tax is not equal to the item tax
|
* ADJUST TAX - Calculations when base tax is not equal to the item tax
|
||||||
*/
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
if ( $item_tax_rates !== $base_tax_rates && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
if ( $item_tax_rates !== $base_tax_rates && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
||||||
|
|
||||||
// Work out a new base price without the shop's base tax
|
// Work out a new base price without the shop's base tax
|
||||||
|
|
Loading…
Reference in New Issue