-
-
Save CmdrMahesh/7438d8cee64924384c49da2eefb83e3d to your computer and use it in GitHub Desktop.
WooCommerce: redirect user upon coupon removal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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