Filter
rpress_get_cart_tax_rate
On this page
Filters the tax rate for the cart.
Runs at the end of rpress_get_cart_tax_rate(). The rate comes from rpress_get_tax_rate() for the given country and state and is cast to a float.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value | float | Tax rate. |
$country | string | Billing country code. |
$state | string | Billing state. |
$postal_code | string | Postal code; unused by core. |
Return value#
float. The tax rate.
Example#
function my_cart_tax_rate( $rate, $country, $state, $postal_code ) {
return $rate;
}
add_filter( 'rpress_get_cart_tax_rate', 'my_cart_tax_rate', 10, 4 );
Notes#
Core ignores the postal code; it is passed so extensions can use it.
Source#
Applied in:
includes/cart/functions.php(line 412), inrpress_get_cart_tax_rate()
See also#
Was this page helpful?
