Skip to content
Docs
Get RestroPress

Filter

rpress_taxed_amount

Updated
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#

ParameterTypeDescription
$taxfloatCalculated tax amount.
$ratefloatDecimal tax rate used.
$countrystring|falseCountry code passed to the calculation, or false.
$statestring|falseState 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), in rpress_calculate_tax()

See also#

Was this page helpful?