Skip to content

Instantly share code, notes, and snippets.

@corsonr
Last active September 25, 2022 09:17
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
WooCommerce: redirect user upon coupon removal
<?php // Do not include this if already open! Code goes in theme functions.php.
/*
* Redirects user to a specific page upon coupon removal.
*/
function action_woocommerce_removed_coupon( $coupon_code ) {
// Redirection...
wp_redirect( $url ); // Replace $url by your page URL.
exit;
};
// add the action
add_action( 'woocommerce_removed_coupon', 'action_woocommerce_removed_coupon', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment