Filter
rpress_taxed_amount
On this page
Filters the tax amount calculated for a given amount.
Runs at the end of rpress_calculate_tax() with the computed tax as a float. The rate is the decimal rate returned by rpress_get_tax_rate(). The calculation honours the prices-include-tax setting unless the caller asked to ignore inclusive pricing.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$tax | float | Calculated tax amount. |
$rate | float | Decimal tax rate used. |
$country | string|false | Country code passed to the calculation, or false. |
$state | string|false | State code passed to the calculation, or false. |
Return value#
float. Tax amount.
Example#
function my_round_tax_up( $tax, $rate, $country, $state ) {
return ceil( $tax * 100 ) / 100;
}
add_filter( 'rpress_taxed_amount', 'my_round_tax_up', 10, 4 );
Source#
Applied in:
includes/tax-functions.php(line 92), inrpress_calculate_tax()
See also#
Was this page helpful?
