Answer the question
In order to leave comments, you need to log in
How to implement a redirect from the thank you page to a random link from an array?
Prompt or direct in the implementation of this task.
The essence of the solution is that instead of a thank you page (in woocomerce ), I could redirect the client to a random external link.
Now the redirect is implemented in this way, the following code is written in the thankyou.php file:
It works without any complaints, but the link must be dynamic, that is, forwarded to pre-specified links using a pre-written method.
That is, after placing an order, a person is constantly redirected to pre-defined links.
Client 1, after placing an order, follows link #1.
The next client after placing an order is sent to the link #2.
Accordingly, the 3rd client, upon completion of the order, goes through the 3rd link,
the 4th client already goes through the link #1.
wp_redirect("http://www.site.com/", 301);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question