WC_Tax::calc_tax()public staticWC 1.0

Calculate tax for a line.

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

Хуки из метода


Массив. Array of rates + prices after tax.


$result = WC_Tax::calc_tax( $price, $rates, $price_includes_tax, $deprecated );
$price(float) (обязательный)
Price to calc tax on.
$rates(массив) (обязательный)
Rates to apply.
Whether the passed price has taxes included.
По умолчанию: false
Whether to suppress any rounding from taking place. No longer used here.
По умолчанию: false

Код WC_Tax::calc_tax() WC 7.1.0

public static function calc_tax( $price, $rates, $price_includes_tax = false, $deprecated = false ) {
	if ( $price_includes_tax ) {
		$taxes = self::calc_inclusive_tax( $price, $rates );
	} else {
		$taxes = self::calc_exclusive_tax( $price, $rates );
	return apply_filters( 'woocommerce_calc_tax', $taxes, $price, $rates, $price_includes_tax, $deprecated );