Filter
rpress_cart_addon_price
On this page
Filters the price of an add-on in the cart.
Runs in RPRESS_Cart::get_addon_price(). When prices include tax, the add-on's tax has already been subtracted, so the value is exclusive of tax.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$addon_price | float|null | Add-on price, exclusive of tax. |
$addon_id | int | Add-on term ID. |
$options | array|null | Cart item data passed to the price lookup. |
Return value#
float|null. The add-on price.
Example#
function my_cart_addon_price( $addon_price, $addon_id, $options ) {
return $addon_price;
}
add_filter( 'rpress_cart_addon_price', 'my_cart_addon_price', 10, 3 );
Source#
Applied in:
includes/cart/class-rpress-cart.php(line 921), inRPRESS_Cart::get_addon_price()
See also#
Was this page helpful?
