Action
rpress_pre_remove_cart_discount
On this page
Fires before a discount code is removed from the cart through the remove link.
Runs in rpress_remove_cart_discount(), which handles the remove_cart_discount request action. The function returns early when discount_id or discount_code is missing from the query string. After both actions run, the user is redirected to the checkout page.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$arg1 | int | Discount ID taken from the discount_id query argument. |
Example#
function my_before_discount_removed( $discount_id ) {
error_log( 'Removing discount ' . $discount_id );
}
add_action( 'rpress_pre_remove_cart_discount', 'my_before_discount_removed' );
Notes#
Only fires for the request-driven removal. It does not run when rpress_unset_cart_discount() is called directly.
Source#
Fired from:
includes/discount-functions.php(line 887), inrpress_remove_cart_discount()
See also#
Was this page helpful?
