Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Woocommerce - Redirect after payment
<?php
/* Redirect user after check out */
add_action( 'template_redirect', 'jay_custom_redirect_after_purchase' );
function jay_custom_redirect_after_purchase() {
global $wp;
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) {
wp_redirect( 'http://www.yoururl.com/your-page/' );
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.