Add check for VAT excemption inside display_prices_including_tax

This commit is contained in:
Mike Jolley 2019-04-03 11:36:43 +01:00
parent d69f014807
commit 11db10807d
1 changed files with 5 additions and 3 deletions

View File

@ -361,7 +361,9 @@ class WC_Cart extends WC_Legacy_Cart {
* @return bool
*/
public function display_prices_including_tax() {
return apply_filters( 'woocommerce_cart_' . __FUNCTION__, 'incl' === $this->tax_display_cart );
$customer_exempt = $this->get_customer() && $this->get_customer()->get_is_vat_exempt();
return apply_filters( 'woocommerce_cart_' . __FUNCTION__, 'incl' === $this->tax_display_cart && ! $customer_exempt );
}
/*
@ -634,9 +636,9 @@ class WC_Cart extends WC_Legacy_Cart {
* @param bool $clear_persistent_cart Should the persistant cart be cleared too. Defaults to true.
*/
public function empty_cart( $clear_persistent_cart = true ) {
do_action( 'woocommerce_before_cart_emptied' );
$this->cart_contents = array();
$this->removed_cart_contents = array();
$this->shipping_methods = array();