Automattic\WooCommerce\StoreApi\Utilities

ProductQuery::adjust_price_filters_for_displayed_taxes()protectedWC 1.0

If price filters need adjustment to work with displayed taxes, this returns true.

This logic is used when prices are stored in the database differently to how they are being displayed, with regards to taxes.

Method of the class: ProductQuery{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->adjust_price_filters_for_displayed_taxes();

ProductQuery::adjust_price_filters_for_displayed_taxes() code WC 8.6.1

protected function adjust_price_filters_for_displayed_taxes() {
	$display  = get_option( 'woocommerce_tax_display_shop' );
	$database = wc_prices_include_tax() ? 'incl' : 'excl';

	return $display !== $database;
}