Merge pull request #17887 from woocommerce/fix/17880

Only remove base taxes in cart totals class if item is taxable
This commit is contained in:
Gerhard Potgieter 2017-11-24 11:21:49 +02:00 committed by GitHub
commit 9f8460c97a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -423,7 +423,7 @@ final class WC_Cart_Totals {
* @return object
*/
protected function remove_item_base_taxes( $item ) {
if ( $item->price_includes_tax ) {
if ( $item->price_includes_tax && $item->taxable ) {
$base_tax_rates = WC_Tax::get_base_tax_rates( $item->product->get_tax_class( 'unfiltered' ) );
// Work out a new base price without the shop's base tax.
@ -449,7 +449,7 @@ final class WC_Cart_Totals {
* @return object
*/
protected function adjust_non_base_location_price( $item ) {
if ( $item->price_includes_tax ) {
if ( $item->price_includes_tax && $item->taxable ) {
$base_tax_rates = WC_Tax::get_base_tax_rates( $item->product->get_tax_class( 'unfiltered' ) );
if ( $item->tax_rates !== $base_tax_rates ) {