Skip to content
Docs
Get RestroPress

Filter

rpress_get_cart_tax

Updated
On this page

Filters the total tax of the cart.

Runs at the end of RPRESS_Cart::get_tax(). The value is the sum of the per-line tax values, recalculated on the discounted subtotal for flat discounts, after passing through rpress_sanitize_amount().

Parameters#

ParameterTypeDescription
$valuefloatCart tax amount.

Return value#

float. The cart tax.

Example#

function my_cart_tax( $cart_tax ) {
	return max( 0, $cart_tax );
}
add_filter( 'rpress_get_cart_tax', 'my_cart_tax', 10, 1 );

Source#

Applied in:

  • includes/cart/class-rpress-cart.php (line 1239), in RPRESS_Cart::get_tax()

See also#

Was this page helpful?