I need to create a coupon in WooCommerce that will only work if the user has an email which ends in .ac.uk
.
For example student.name@uwl.ac.uk
or teacher@kings.ac.uk
.
The discount would be 10% off the total shopping basket.
I can't find any solutions online or any plugins which could help.
Any ideas?
Thanks.
You can use this Auto apply Discount Coupon to Customer’s Purchase function with the right conditionals (user email finishing by
ac.uk
):You will have to set in WooCommerce coupon settings a coupon with the desire behavior (10% off) and you will report this coupon slug in this function.
Copy code in the functions.php file located in your active theme or better your active child theme.