Customers usually enter a referral code in the referral code form, or arrive with a referral link. You can also let them type the code in the WooCommerce coupon field of your cart. This article shows how to turn that on and what happens next.
Turn it on
In your administration, go to
In the WooCommerce coupon input field section, toggle on Read Referral Code in Coupon field and save. The section says: Let the customer enters the referral code as a coupon code in your cart. The option is off by default.
The coupon field only gives a discount if the referee reward is on. In the same Rewards tab, check that Enabled is on in the Referee cart discount Reward group. If it is off, the plugin ignores the code.
What happens when a customer types a code
- The plugin looks for a referral code equal to the text typed in the coupon field. Capital letters and spaces around the code do not matter.
- If the code exists, the cart gets a discount built from your referee reward settings: Mode, Value, Minimum spend and Individual use only.
- The coupon is shown in the cart totals as Referral from CODE on the classic cart and checkout, and as Referred by CODE on the Cart and Checkout blocks.
- The code becomes the customer’s current referral, exactly as if they had used the referral code form or a referral link.
If the text typed does not match any referral code, the plugin does not step in and WooCommerce answers as it does for any unknown coupon. When the option is off, a code typed in the coupon field is not read as a referral code.
When the code is refused
The same rules apply as for the referral code form:
- A customer cannot use their own referral code.
- If you restricted referral codes to some roles with Role restriction, the code of a referrer outside these roles is refused.
In both cases the customer sees You are not allowed to use this referral code, or it is not valid anymore. If Usable only once is on and the customer already used a referral code, the cart shows Using a referral was only allowed once.
One referral code at a time
- If the customer’s current referral is a different code, the older referral coupon is removed from the cart.
- If the customer removes the referral coupon from the cart, the current referral is cleared too.