From 0830543c4f6cf8dc6c690979c510a8d58fc85c5a Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 15 Sep 2015 16:01:11 +0100 Subject: [PATCH] Add disclaimer to woocommerce_adjust_non_base_location_prices --- includes/abstracts/abstract-wc-product.php | 5 +++++ includes/class-wc-cart.php | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index c1b92878ee2..d5b3899cdd0 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -827,6 +827,11 @@ class WC_Product { $base_tax_amount = array_sum( $base_taxes ); $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 ) ) { $base_taxes = WC_Tax::calc_tax( $price * $qty, $base_tax_rates, true ); diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index 703e5a4f2e5..7a795d7b8ca 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -1142,7 +1142,11 @@ class WC_Cart { /** * 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 ) ) { // 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 - */ + * + * 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 ) ) { // Work out a new base price without the shop's base tax