Skip to content
Docs
Get RestroPress

Filter

rpress_cart_item

Updated
On this page

Filters the rendered HTML of a cart item.

Runs at the end of rpress_get_cart_item_template(), after the cart/item template part has been rendered and its placeholders (title, price, add-ons, remove URL and so on) have been replaced.

Parameters#

ParameterTypeDescription
$itemstringRendered cart item HTML.
$idintMenu item (fooditem) post ID of the cart line.

Return value#

string. The cart item HTML.

Example#

function my_cart_item_html( $item, $id ) {
	return str_replace( 'rpress-cart-item', 'rpress-cart-item my-cart-item', $item );
}
add_filter( 'rpress_cart_item', 'my_cart_item_html', 10, 2 );

Source#

Applied in:

  • includes/cart/template.php (line 155), in rpress_get_cart_item_template()
Was this page helpful?