Add check for VAT excemption inside display_prices_including_tax
This commit is contained in:
parent
d69f014807
commit
11db10807d
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue