I am looking out to redirect user to specific pages which will vary from product to product. So, once user completes payment for Product A, he will be redirected to Link A , which is an external link.
If he buys Product B, he will be redirected to Product B.
If not, At least I want to display dynamic URL on checkout page based on the product, once user completes payment.
Any input for this functionality ?
I tried the Affiliate link/Virtual products in woo commerce but its a different thing ..
3
Answers
Your algoritm:
The following will redirect to specifics Url based on order item (product Id) once customer complete payment and order has ‘processing’ or ‘completed’ status:
Code goes in function.php file of the active child theme (or active theme). Tested and works.
Related: Redirect automatically from Woocommerce thankyou to an external link passing variables
I created a simple plugin using the code below to accomplish something similar…
/*
Plugin Name: Woocommerce Custom Thank You page per Product
Description: This plugin will allow you to set up a custom thank you page per product for woocommerce.
Author: Gabriel Collignon
*/