Thanks! This is the code that I have. What I would like to happen is that this function will only happen once. Then the succeeding purchases will redirect infinitely to another page.
// Redirect WooCommerce checkout page to a custom thank you page
add_action( 'woocommerce_thankyou', 'tinkerclubs_redirect_woo_checkout');
function tinkerclubs_redirect_woo_checkout( $order_id ){
$order = wc_get_order( $order_id );
$url = 'https://tinkerclubs.com/thanks-purchase/';
if ( ! $order->has_status( 'failed' ) ) {
wp_safe_redirect( $url );
exit;
}
}
Is that possible? Hope someone could help.