Action
rpress_post_remove_from_cart
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#
| Parameter | Type | Description |
|---|---|---|
$key | int | Cart line key that was removed. |
$item_id | int|null | Menu 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), inRPRESS_Cart::remove()
See also#
Was this page helpful?
