Filter
rpress_get_price_option_amount
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#
| Parameter | Type | Description |
|---|---|---|
$amount | string | Sanitized price amount. |
$fooditem_id | int | ID of the menu item. |
$price_id | int | ID 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), inrpress_get_price_option_amount()
See also#
Was this page helpful?
