Filter
rpress_get_cart_addon_tax
On this page
Filters the tax calculated for an add-on in the cart.
Runs at the end of RPRESS_Cart::get_addon_tax(). The tax is zero for add-ons flagged as tax exclusive and is never negative before filtering.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value | float | Tax amount for the add-on. |
$addon_id | int | Add-on term ID. |
$options | array | Cart item data. |
$subtotal | float | Add-on subtotal the tax was calculated on. |
Return value#
float. The tax amount.
Example#
function my_cart_addon_tax( $tax, $addon_id, $options, $subtotal ) {
return round( $tax, 2 );
}
add_filter( 'rpress_get_cart_addon_tax', 'my_cart_addon_tax', 10, 4 );
Source#
Applied in:
includes/cart/class-rpress-cart.php(line 973), inRPRESS_Cart::get_addon_tax()
See also#
Was this page helpful?
