This tutorial will show you how to make a coupon in WooCommerce that only works for logged in users. You can use this to give a special deal for your returning customers or for people who register on your store ahead of time.
It’s a great way to separate your logged in users (people who may be returning customers) from the guest users on your site and treat them a little bit differently when it comes to running a special deal.
What we want to do is set up a coupon, but only allow the coupon to be applied if the customer is actually logged in to an account.
To do this we will be using our WooCommerce extension Advanced Coupons which adds a lot of extra features to coupons.
We’re going to be focusing on the Cart Conditions feature which has a special condition called “Customer Logged In Status”.
This condition basically does what it says on the tin. It checks the logged-in status of your customer during the coupon application process.
Here is a video tutorial of how to make a coupon only for logged in customers in WooCommerce:
If you aren’t able to watch the video above I’ve detailed the steps here:
Step 1 – Create and name your coupon
I’ve talked a few times about using a naming convention for your coupons.
It’s really important to name your coupons properly so you can find them easily months or years down the track.
After a few years running your store, you’ll likely have hundreds if not thousands of coupons and this can be a lifesaver.
In this step, I’m going to assume that you’ve also set the other coupon details like how much to give (eg. percentage discount, fixed discount, etc)
Step 2 – Add the cart condition
Next, you need to go to the Cart Condition feature in your coupon edit screen.
If you don’t see this tab, you need Advanced Coupons for WooCommerce which is responsible for adding these extra features.
The Cart Conditions interface lets you build up “rules” for your coupon. These rules need to be true before the coupon will be allowed to be applied.
The one we’re after is the “Customer Logged In Status” which checks if the user is logged in or not. You can also combine this rule with other rules to make complex condition groups.
Step 3 – Make sure it’s checking for Logged In users
As I mentioned, you need to add the “Customer Logged In Status”. You also need to make sure that you are checking for “Logged In” not for “Guest”.
In this way, the rule can also work in reverse if you were wanting to make a coupon just for guest customers to use.
Step 4 – Save and test
Save the coupon and now you are ready to test it on the front end of your site.
To test it you will need to have both a logged-in session and a logged out session.
You can do this by opening two different browsers and only logging into a customer account on one of them.
The other way is to use an Incognito or Private Browsing window (check the File menu on your browser) which provides a completely fresh logged out browser session to test with.
So to test properly, let’s try applying the coupon with the logged-in customer window:
And now lets test with the Incognito window which represents a logged out customer:
You might think that doing this extra testing is going a bit overboard.
But testing is really important when you put together a deal. A misconfigured deal due to a silly mistake can lead to thousands of lost revenue when you send it out to your customers and it’s not working as intended.
A quick 5-minute test will let you sleep at night 😉