Usually in WooCommerce submitted orders are redirect to /order-received/
once payment is completed.
Is it possible to redirect customer to a custom page for a particular payment method?
For example:
Payment method 1 -> /order-received/
Payment method 2 -> /custom-page/
Payment method 3 -> /order-received/
With a custom function hooked in
template_redirect
action hook using the conditional functionis_wc_endpoint_url()
and targeting your desired payment method to redirect customer to a specific page:Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested and works.