Skip to content
Docs
Get RestroPress

Filter

rpress_get_price_option_amount

Updated
On this page

Filters the amount of a variable price option.

Runs in rpress_get_price_option_amount with the sanitized amount of the price option, or 0.00 when the price ID is not found. It is used when items are added to the cart and for variation pricing.

Parameters#

ParameterTypeDescription
$amountstringSanitized price amount.
$fooditem_idintID of the menu item.
$price_idintID of the price option.

Return value#

string. The price amount.

Example#

function my_price_option_amount( $amount, $fooditem_id, $price_id ) {
	return rpress_sanitize_amount( (float) $amount + 0.50 );
}
add_filter( 'rpress_get_price_option_amount', 'my_price_option_amount', 10, 3 );

Source#

Applied in:

  • includes/fooditem-functions.php (line 287), in rpress_get_price_option_amount()

See also#

Was this page helpful?