woocommerce_get_shipping_tax
Filter the shipping rate taxes.
Usage
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(array)
- The shipping rate taxes.
- $that(WC_Shipping_Rate)
- The shipping rate object.
Changelog
| Since 3.2.0 | Introduced. |
Where the hook is called
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 );