WC_Product_Variable_Data_Store_CPT::taxes_influence_priceprotectedWC 10.4.0

Check if the prices for a product will be different with or without taxes.

Метод класса: WC_Product_Variable_Data_Store_CPT{}

Хуков нет.

Возвращает

true|false. True if the prices will be different with or without taxes.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->taxes_influence_price( $product ): bool;
$product(WC_Product) (обязательный)
Product to check.

Список изменений

С версии 10.4.0 Введена.

Код WC_Product_Variable_Data_Store_CPT::taxes_influence_price() WC 10.8.1

protected function taxes_influence_price( $product ): bool {
	if ( ! $product->is_taxable() ) {
		return false;
	}

	if ( empty( WC_Tax::get_rates( $product->get_tax_class() ) ) ) {
		return false;
	}

	if ( ! empty( WC()->customer ) && WC()->customer->get_is_vat_exempt() ) {
		return false;
	}

	return true;
}