Skip to content
Docs
Get RestroPress

Filter

rpress_cart_item_price_label

Updated
On this page

Filters the formatted price label shown for a cart item.

Runs in RPRESS_Cart::item_price(). The value is the currency-formatted item price followed by an (empty by default) label.

Parameters#

ParameterTypeDescription
$valuestringFormatted item price with label appended.
$item_idintMenu item (fooditem) post ID.
$optionsarrayCart item options, such as price_id.

Return value#

string. The price label.

Example#

function my_cart_item_price_label( $label, $item_id, $options ) {
	return $label . ' ' . esc_html__( 'each', 'my-textdomain' );
}
add_filter( 'rpress_cart_item_price_label', 'my_cart_item_price_label', 10, 3 );

Source#

Applied in:

  • includes/cart/class-rpress-cart.php (line 870), in RPRESS_Cart::item_price()
Was this page helpful?