Skip to content
Docs
Get RestroPress

Filter

rpress_get_cart_item_price_name

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

ParameterTypeDescription
$namestringPrice option name.
$arg2intMenu item (fooditem) post ID.
$price_idintPrice ID of the cart line.
$itemarrayThe 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), in RPRESS_Cart::get_item_price_name()

See also#

Was this page helpful?