Filter
rpress_get_cart_item_price_name
On this page
Filters the price option name of a cart item.
Runs in RPRESS_Cart::get_item_price_name(). The name is looked up from the menu item's variable prices using the line's price ID, and is empty when none matches.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$name | string | Price option name. |
$arg2 | int | Menu item (fooditem) post ID. |
$price_id | int | Price ID of the cart line. |
$item | array | The cart line. |
Return value#
string. The price option name.
Example#
function my_cart_item_price_name( $name, $fooditem_id, $price_id, $item ) {
return trim( $name );
}
add_filter( 'rpress_get_cart_item_price_name', 'my_cart_item_price_name', 10, 4 );
Source#
Applied in:
includes/cart/class-rpress-cart.php(line 1194), inRPRESS_Cart::get_item_price_name()
See also#
Was this page helpful?
