woocommerce_get_shipping_tax хук-фильтрWC 3.2.0

Filter the shipping rate taxes.

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

add_filter( 'woocommerce_get_shipping_tax', 'wp_kama_woocommerce_get_shipping_tax_filter', 10, 2 );

/**
 * Function for `woocommerce_get_shipping_tax` filter-hook.
 * 
 * @param array            $taxes The shipping rate taxes.
 * @param WC_Shipping_Rate $that  The shipping rate object.
 *
 * @return array
 */
function wp_kama_woocommerce_get_shipping_tax_filter( $taxes, $that ){

	// filter...
	return $taxes;
}
$taxes(массив)
The shipping rate taxes.
$that(WC_Shipping_Rate)
The shipping rate object.

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

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

Где вызывается хук

WC_Shipping_Rate::get_shipping_tax()
woocommerce_get_shipping_tax
woocommerce/includes/class-wc-shipping-rate.php 337
return apply_filters( 'woocommerce_get_shipping_tax', count( $taxes ) > 0 && ! WC()->customer->get_is_vat_exempt() ? (float) array_sum( $taxes ) : 0.0, $this );

Где используется хук в WooCommerce

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