The below code snippet allows you to redirect to a custom page after the user has successfully completed a purchase when using Subscription for WooCommerce plugin.
You can add the below given code snippet to the active child theme’s functions.php and replace the URL in the function wo_redirect() to the desired page.
- Was this article helpful?
- Yes, thanks!Not really
Comments (9)
Dan
April 15, 2021
We tested this using the one-time option (non-subscription) you can select on a subscription product using this plugin:
https://woocommerce.com/products/all-products-for-woocommerce-subscriptions/
And even though it was not a subscription product, it redirected to the custom page.
Is there any modification to provide support?
Thanks in advance
Mark
April 16, 2021
Hi Dan,
The plugin you mention is developed by Woocommerce plugin and is designed to work with only the Woocommerce Subscription plugin. Sorry that we cannot help out.
James
February 8, 2021
Is this code ignored if the purchaser has purchased a non-subscription product?
Mark
February 15, 2021
Yes. It works only if the user purchases a subscription product.
Ramy Ezzedine
December 23, 2020
Hello,
Excellent code, it’s working well! Will you have a similar code for when you login and have an Active Subscription to redirect to a page?
Thank you!
Ramy
Mark
December 29, 2020
The code given in the article is to redirect while purchasing a subscription which is when the subscription becomes active.
Ramy
January 2, 2021
Hi Mark – yes that’s correct, I want to have a similar behavior for a user who already made his purchase, comes back to the site and login, he access directly a specific page.
Mark
January 25, 2021
Currently, we do not have a filter to achieve this. Sorry about that.
Diseño web Sevilla
February 4, 2020
Hi thanks for the post, but can it be done with some plugin. I.m trying in my web https://nosunelanube.com for a suscription and I have not knowledge about codes. Thanks