Filter
rpress_cart_item_price_label
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#
| Parameter | Type | Description |
|---|---|---|
$value | string | Formatted item price with label appended. |
$item_id | int | Menu item (fooditem) post ID. |
$options | array | Cart 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), inRPRESS_Cart::item_price()
Was this page helpful?
