Skip to content
Docs
Get RestroPress

Filter

rpress_cart_addon_price

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

ParameterTypeDescription
$addon_pricefloat|nullAdd-on price, exclusive of tax.
$addon_idintAdd-on term ID.
$optionsarray|nullCart 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), in RPRESS_Cart::get_addon_price()

See also#

Was this page helpful?