Check if product is taxable.

This commit is contained in:
Mike Jolley 2017-02-22 10:41:39 +00:00
parent 4e4c0bc5fa
commit 1098d49526
1 changed files with 2 additions and 2 deletions

View File

@ -1890,12 +1890,12 @@ class WC_Cart {
$discount_amount = min( $price, $discount_amount );
$price = max( $price - $discount_amount, 0 );
// Store the totals for DISPLAY in the cart
// Store the totals for DISPLAY in the cart.
if ( $add_totals ) {
$total_discount = $discount_amount * $values['quantity'];
$total_discount_tax = 0;
if ( wc_tax_enabled() ) {
if ( wc_tax_enabled() && $product->is_taxable() ) {
$tax_rates = WC_Tax::get_rates( $product->get_tax_class() );
$taxes = WC_Tax::calc_tax( $discount_amount, $tax_rates, $this->prices_include_tax );
$total_discount_tax = WC_Tax::get_tax_total( $taxes ) * $values['quantity'];