WC_Shipping_Rate::get_shipping_taxpublicWC 1.0

Get shipping tax.

Method of the class: WC_Shipping_Rate{}

Hooks from the method

Returns

float.

Usage

$WC_Shipping_Rate = new WC_Shipping_Rate();
$WC_Shipping_Rate->get_shipping_tax();

WC_Shipping_Rate::get_shipping_tax() code WC 10.4.3

public function get_shipping_tax() {
	$taxes = $this->get_taxes();

	/**
	 * Filter the shipping rate taxes.
	 *
	 * @since 3.2.0
	 * @param array $taxes The shipping rate taxes.
	 * @param WC_Shipping_Rate $this The shipping rate object.
	 */
	return apply_filters( 'woocommerce_get_shipping_tax', count( $taxes ) > 0 && ! WC()->customer->get_is_vat_exempt() ? (float) array_sum( $taxes ) : 0.0, $this );
}