NEWDiscoverShipGoal– turn cart progress into bigger baskets
All articles

A Shopify block country rule can stop orders to countries you cannot ship to. You can also use BlockCart for Shopify ZIP code validation: check the shipping address and show customers an error at Shopify checkout.

Before you start

You need an active BlockCart subscription to save a rule. Decide which countries or postal codes you want to block, and write a message that tells customers why they cannot complete the order.

Set up the rule

  1. From BlockCart, select Create new rule. In the dialog, choose Cart and checkout validation.
  2. Give the rule a name. Keep Rule input set to Standard input.
  3. Under Eligibility, choose Only when conditions match.
  4. To block postal codes, choose Zip code and is one of. Enter one ZIP or postal code per line. Use * for a range, such as 902* to match codes starting with 902.
  5. To block countries too, select Add group (OR). In the new group, choose Shipping country and is one of. Select Select countries, pick every country you want to block, then select Confirm. Use Search countries to find a country quickly. This makes the rule match either the ZIP list or any of those countries.
  6. In Error message, tell the customer what happened, for example, “We can't ship to this destination. Please use another shipping address.” Choose where to show it under Target placement.
  7. Set Status to Live, then Save. To try it first, pick Test and use a tagged account. Try a blocked destination in Shopify checkout to check the message.

TODO screenshot: checkout rule editor with Zip code is one of, a Shipping country OR group, and an error message

Example

| Rule input | Conditions | Error message | | -------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | | Standard input | Zip code is one of 902*, 10001 OR Shipping country is one of Canada, Mexico | We can't ship to this destination. Please use another shipping address. |

Good to know

  • is one of checks the whole postal code. An entry without * must match exactly. The * wildcard can match any number of characters. Put each code or pattern on its own line. For more examples, see Use ZIP code lists and wildcards.
  • Shipping country checks the country code in the shipping address. Use it when you want to restrict shipping countries in Shopify. Customer country checks a different value.
  • To allow only certain countries, flip the condition: Shipping country is not one of with the countries you ship to. The rule then blocks every other destination once the customer enters a shipping address. It does not match while the shipping address is still missing.
  • If you don't ship to a country at all, you can also leave it out of your Shopify shipping zones. Shopify then won't offer shipping there. BlockCart is most useful for ZIP-level blocks or for blocks that depend on other conditions.
  • A rule checking the shipping address cannot match until that address is available. Rule input is locked after you create the rule, so choose it before saving.

Related articles