Regional codes are one of the cheapest ways to test a new market. A code for New Zealand shoppers, printed in a Kiwi newsletter. A code for a stockist's customers in the UK. A spring sale that only makes sense in the northern hemisphere.

The catch is that codes travel. Once one lands on a coupon website, anyone can use it, and a discount meant to win over a new market ends up coming off your best-paying domestic orders. So you want the code to check where the order is going.

What WooCommerce can do on its own

We checked WooCommerce 11.1. A coupon's Usage restriction and Usage limits tabs offer:

  • Minimum spend and maximum spend
  • Individual use only, and exclude sale items
  • Products, excluded products, product categories and excluded categories
  • Allowed emails, checked against the customer's billing or account email
  • Usage limit per coupon, per user, and a limit on the number of items

Plus an expiry date on the General tab. There's no country, region or address field anywhere, and WooCommerce's own coupon checks run through usage, expiry, spend, products, categories and email addresses, never the delivery address.

Workaround 1: free shipping by zone

If the offer is free shipping, WooCommerce can get close. Tick Allow free shipping on the coupon. Then, in the shipping zone for the country you're targeting, add a Free shipping method and set Free shipping requires to A valid free shipping coupon.

The code then unlocks free shipping only in that zone. But the coupon itself is still accepted everywhere, so any discount amount on it applies to every country, and a customer elsewhere sees their code accepted with nothing to show for it.

Workaround 2: allowed emails

If you know exactly who the code is for, list their email addresses. That works for a handful of wholesale customers. It doesn't work for a newsletter or a partner's audience.

Workaround 3: a few lines of code

A developer can add the country check with WooCommerce's woocommerce_coupon_is_valid filter:

add_filter( 'woocommerce_coupon_is_valid', function ( $valid, $coupon ) {
    // Coupon codes are stored in lower case.
    if ( ! $valid || 'hellonz10' !== $coupon->get_code() ) {
        return $valid;
    }
    $customer = WC()->customer;
    $country  = $customer ? ( $customer->get_shipping_country() ?: $customer->get_billing_country() ) : '';
    return 'NZ' === $country;
}, 10, 2 );

It works for one code and one country. Each new campaign means another edit, a customer outside the region sees WooCommerce's generic "Coupon is not valid.", and a continent means typing out every country in it.

Regional coupons with International Fees and Coupons

Tradewind International Fees and Coupons is a free WooCommerce plugin that hangs fees and coupon codes off regions, where a region is a single country or a whole continent. To make a regional code:

  1. Go to WooCommerce > Fees and Coupons.
  2. Choose a country, or a continent marked "(all countries)", and click Add region.
  3. Click Add coupon and enter the code.
  4. Set the amount, as a percentage or a fixed amount off the cart.
  5. Optionally, limit it to one shipping method, or to an order value: greater than, at least, less than, at most, or exactly an amount you set.
  6. Optionally, add a description, which is copied to the WooCommerce coupon, and save.

On save, the plugin creates a real WooCommerce coupon with that code, type and amount (the WooCommerce coupons setting that does this is on by default). It shows under Marketing > Coupons, customers type it into the usual coupon box, and it appears in WooCommerce's reports like any other code.

When a customer applies it, the plugin looks at the delivery country: the shipping country, or the billing country if there's no shipping address. The code is accepted if that country is the region, or sits in the continent, and the rule's shipping method and order value conditions are met. Otherwise the customer sees your rejection message.

WooCommerce checks applied coupons again when the order is placed, on both the classic checkout and the Checkout block. So a customer who applies a New Zealand code and then changes the delivery address to Sydney doesn't keep the discount.

Four set-ups worth stealing

  • A new-market launch. Region: New Zealand. Code HELLONZ10, 10% off, order value at least $60. Put it in your first NZ ads and see who uses it.
  • One code for a continent. Region: Europe (all countries). Code EUROPE15, 15% off for a European campaign, with no need to list 50-odd countries.
  • A partner's code. Region: United Kingdom. A code for a UK stockist's or creator's audience, which does nothing if it leaks back to Australia.
  • A shipping nudge. Region: United States. $10 off, only with your tracked international method, only on orders at least $100. It rewards the service you'd rather they chose.

A country also picks up its continent's codes. So Germany can have a code of its own while still accepting EUROPE15.

Check the continent before you use it

Continents come from WooCommerce's own list, so they match the country dropdowns elsewhere in your store. Two things in that list surprise Australian stores:

  • Oceania includes Australia. An "Oceania (all countries)" code works for your domestic customers too. For a Pacific offer, add New Zealand, Fiji and the rest as separate countries instead.
  • Europe isn't the EU. WooCommerce's Europe includes the UK, Norway, Switzerland and Turkey, and puts Cyprus, an EU member, in Asia.

The details that matter

  • One regional code per order. By default a customer can use only one of these codes on an order. Turn on Stackable coupons to allow more. Coupons from other plugins aren't affected either way.
  • One amount per code. A code can be listed under several regions, and it's accepted for all of them, but it takes its amount from the first region it's listed under. For 10% in one country and 15% in another, use two codes.
  • No exceptions inside a continent. A continent code covers every country in it. To leave one out, add the code to each country you do want.
  • Countries only. There are no state or postcode regions.
  • WooCommerce's own limits still apply. WooCommerce runs its checks first, then the plugin adds the region. Set an expiry date, a usage limit, product categories or a minimum spend on the coupon under Marketing > Coupons. When you save your regional rules, the plugin updates only the code, type, amount and description, so those settings stay.
  • Existing codes are taken over. If a WooCommerce coupon with the same code already exists, the plugin updates it: its type and amount then come from your rule.
  • Removed codes stop working, but stay. Take a code out of the rules and the WooCommerce coupon is kept, because past orders reference it, but it's no longer accepted at checkout.
  • Postage, if you want it. Include shipping costs in coupon discounts lets a percentage code take the same percentage off postage. Include shipping costs in the order value conditions decides whether "at least $100" means goods, or goods plus postage.

Write a rejection message that sells

Until a customer enters an address, WooCommerce guesses their country from Default customer location under WooCommerce > Settings > General. The default is Shop country/region, so on an Australian store, a Kiwi who tries HELLONZ10 in the cart is treated as Australian until they enter their address, and sees the rejection message.

The default message is "This coupon is not available for your delivery address." You can change it under WooCommerce > Fees and Coupons. It's one message for every regional code, so make it helpful rather than final:

That code is for delivery to certain countries. If that's you, enter your delivery address at checkout and try it again.

Campaigns that start and stop on their own (Pro)

WooCommerce gives a coupon an expiry date, but no start date. International Fees and Coupons Pro adds a first and last day to every rule, coupons included, read in your store's own timezone. So a code listed under two regions can run a week in the UK and a fortnight in New Zealand, and you can set up a campaign now that switches itself on the morning it starts.

The same plugin also charges fees by country or continent, which is how many stores now charge US import duty at checkout. See how to charge import duty at checkout in WooCommerce.

Checklist

  • A region for each market: a country, or a continent if every country in it qualifies
  • Not Oceania, unless Australians should get the discount too
  • Separate codes where the amount should differ
  • Expiry and usage limits set on the WooCommerce coupon
  • A rejection message that tells customers to enter their address
Codes that only work where you send them.
Tradewind International Fees and Coupons is free and limits any WooCommerce coupon to a country or continent. Pro adds start and end dates to every rule.