K
K
Ksander882020-06-24 16:11:35
WordPress
Ksander88, 2020-06-24 16:11:35

How to make redirects to the thank you page within the multisite after completing an order on Woocomerce?

Hello, I have a question about redirecting to the thank you page after completing the order in Woocomerce , the fact is that we used this code in the function :

add_action( 'template_redirect', 'wc_custom_redirect_after_purchase' );
function wc_custom_redirect_after_purchase() {
global $wp;

if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) {
wp_redirect( 'https://site.ru/spasibo/' );
exit;
}
}


But now we already have a network of sites on subdomains and, for example, from a subdomain: msk.site.ru also redirects to the main domain, how to make redirects to the thank you page within a multisite after completing an order on Woocomerce?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question