The WooCommerce Coupon Restrictions extension provides you with expanded coupon restriction options. With this extension you can create targeted coupons for new customers, user roles, countries or zip codes. You can also prevent coupon abuse with enhanced usage limits.
Installation
↑ Back to top- Download the extension from your WooCommerce dashboard.
- Go to Plugins > Add New > Upload and select the ZIP file you just downloaded.
- Select Install Now, and then Activate.
Setup and Configuration
↑ Back to topWhen the extension is activated for the first time, you’ll see a notice at the top of the dashboard with a link to tour how the extension works. New coupon restrictions are available in the coupon edit screen under the “Usage Restriction” section.
You can always go through the onboarding tour again by clicking the “New Coupon” link under “WooCommerce Coupon Restrictions” on the plugin admin page.
This extension has just one setting. By default the “new customer” validation checks against existing customer accounts. If you have guest checkout enabled, and would like WooCommerce to check against all guest orders too, you can enable that in “WooCommerce Settings > General” under the “Coupon Restrictions” label.
How to Add a Customer Restriction
↑ Back to topYou can limit a coupon to new customers or existing customers. To add a customer restriction:
- Go to the coupon edit screen.
- Select the “Usage Restriction” tab.
- Select “New customers only” or “Existing customers only”
- Save the coupon.
New Customer Definition
For this extension to work optimally, it’s recommended to disable guest checkout and instead automatically create a new user account for new customers. This way the extension can easily check against existing customer accounts to determine if the customer is new. However, if you do have guest checkout enabled and would like to also check new customers against all existing orders, that can be enabled in “WooCommerce Settings > General” under the “Coupon Restrictions label.
Customers are considered “new customers” if they have not yet completed an order on the site.
Customers are still considered “new customers” while their first order is “processing”. To ensure a new customer can only use a specific coupon coupon once, set the “Usage limit per user” on the coupon to 1.
Users who have an account on the site, but no completed purchases, are still considered new customers.
How to Add a Location Restriction
↑ Back to top- Go to the coupon edit page.
- Select the “Usage Restriction” tab.
- Tick the “Use location restrictions” checkbox.
- Select whether you want the location restriction to apply to the “Billing” or “Shipping Restriction”
- Select a country restriction, zip code restriction, or both.
- Save the coupon.
The country restriction allows you to select any country your shop currently sells to.
For State restrictions, you will use the State or Province abbreviation in most cases. i.e. TX for Texas, or BC for British Colombia.
For alphanumeric postal codes, case is not sensitive. You can use uppercase or lowercase characters.
How to Add an Enhanced Usage Limit
↑ Back to top- Go to the coupon edit page.
- Select the “Usage Limits” tab.
- Set one (or all) of the enhanced usage limit options.
- Save the coupon.
The enhanced usage limits work by storing data into a custom table (wcr_coupon_verification). Each time a coupon with enhanced usage limits is used, the email, shipping address, and IP address are stored in this table. When a new checkout is in progress using a coupon tht has enhanced usage limits, it is verified against this table.
If enhanced usage limits are added to a coupon that already has usage, new checkouts cannot be compared against previous orders. However, the verifications will work on any new orders moving forward.
If you do wish to populate the verification table with historic order data and have SSH access to your server, you can run the WP CLI command “wp wcr refresh_enhanced_usage_limits_table”. This will prompt you for the coupon code, and then populate the table by iterating through all orders made since the coupon was created (I wish there was a better way!). This CLI command can take a long time to run. If it times out, you can restart it without any loss of data.
Questions & Support
↑ Back to topHave a question before you buy? Please fill out this pre-sales contact form.
Already purchased and need some assistance? Get in touch with support via the help desk.