Skip to content

Instantly share code, notes, and snippets.

@wtmujeebu
Created June 14, 2018 06:10
Show Gist options
  • Save wtmujeebu/f8dd00f4436c5327b47db623e552e1ec to your computer and use it in GitHub Desktop.
Save wtmujeebu/f8dd00f4436c5327b47db623e552e1ec to your computer and use it in GitHub Desktop.
Redirect to custom page after successful purchase - WebToffee WooCommerce Subscriptions
add_action('template_redirect', 'webtoffee_custom_redirect_after_purchase');
function webtoffee_custom_redirect_after_purchase() {
global $wp;
if (is_checkout() && !empty($wp->query_vars['order-received'])) {
wp_redirect('http://www.webtoffee.com/'); // Redirect to your desired page here.
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment