Skip to content
Docs
Get RestroPress

Filter

rpress_get_cart_item_name

Updated
On this page

Filters the display name of a cart item.

Runs in RPRESS_Cart::get_item_name(). The title is the menu item title, with the price option name appended when the item has variable prices.

Parameters#

ParameterTypeDescription
$item_titlestringCart item title.
$arg2intMenu item (fooditem) post ID.
$itemarrayThe cart line.

Return value#

string. The item name.

Example#

function my_cart_item_name( $item_title, $fooditem_id, $item ) {
	return wp_strip_all_tags( $item_title );
}
add_filter( 'rpress_get_cart_item_name', 'my_cart_item_name', 10, 3 );

Source#

Applied in:

  • includes/cart/class-rpress-cart.php (line 1212), in RPRESS_Cart::get_item_name()

See also#

Was this page helpful?