Skip to content

Commit

Permalink
Brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Mar 25, 2014
1 parent b7df017 commit 2f605e7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions includes/class-wc-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -1213,8 +1213,9 @@ public function calculate_totals() {
}

// VAT exemption done at this point - so all totals are correct before exemption
if ( WC()->customer->is_vat_exempt() )
if ( WC()->customer->is_vat_exempt() ) {
$this->remove_taxes();
}

// Cart Discounts (after tax)
$this->apply_cart_discounts_after_tax();
Expand All @@ -1231,8 +1232,9 @@ public function calculate_totals() {
$this->tax_total = $this->tax->get_tax_total( $this->taxes );

// VAT exemption done at this point - so all totals are correct before exemption
if ( WC()->customer->is_vat_exempt() )
if ( WC()->customer->is_vat_exempt() ) {
$this->remove_taxes();
}

// Cart Discounts (after tax)
$this->apply_cart_discounts_after_tax();
Expand All @@ -1249,10 +1251,11 @@ public function calculate_totals() {
*/
public function remove_taxes() {
$this->shipping_tax_total = $this->tax_total = 0;
$this->subtotal = $this->subtotal_ex_tax;
$this->subtotal = $this->subtotal_ex_tax;

foreach ( $this->cart_contents as $cart_item_key => $item )
foreach ( $this->cart_contents as $cart_item_key => $item ) {
$this->cart_contents[ $cart_item_key ]['line_subtotal_tax'] = $this->cart_contents[ $cart_item_key ]['line_tax'] = 0;
}

// If true, zero rate is applied so '0' tax is displayed on the frontend rather than nothing.
if ( apply_filters( 'woocommerce_cart_remove_taxes_apply_zero_rate', true ) ) {
Expand Down

0 comments on commit 2f605e7

Please sign in to comment.