Skip to content
Docs
Get RestroPress

Action

rpress_post_remove_from_cart

Updated
On this page

Fires after an item has been removed from the cart.

Runs in RPRESS_Cart::remove() after the line is unset, the cart is re-indexed and saved to the session.

Parameters#

ParameterTypeDescription
$keyintCart line key that was removed.
$item_idint|nullMenu item ID of the removed line, or null if it could not be determined.

Example#

function my_post_remove_from_cart( $key, $item_id ) {
	if ( $item_id ) {
		delete_transient( 'my_cart_suggestions_' . $item_id );
	}
}
add_action( 'rpress_post_remove_from_cart', 'my_post_remove_from_cart', 10, 2 );

Source#

Fired from:

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

See also#

Was this page helpful?