WC_Tax::calc_shipping_tax()public staticWC 1.0

Calculate the shipping tax using a passed array of rates.

Method of the class: WC_Tax{}

Hooks from the method

Return

Array.

Usage

$result = WC_Tax::calc_shipping_tax( $price, $rates );
$price(float) (required)
Shipping cost.
$rates(array) (required)
Taxation Rate.

WC_Tax::calc_shipping_tax() code WC 8.7.0

public static function calc_shipping_tax( $price, $rates ) {
	$taxes = self::calc_exclusive_tax( $price, $rates );
	return apply_filters( 'woocommerce_calc_shipping_tax', $taxes, $price, $rates );
}