NEWDiscoverShipGoal– turn cart progress into bigger baskets
All articles

Use BlockCart to restrict products by country, state, or ZIP code in Shopify checkout. You can also restrict products in a collection by ZIP code, but collection rules cannot check the shipping country or state.

Before you start

You need an active BlockCart subscription to save a rule. Decide which products or collections and destinations you want to block.

Restrict selected products by location

  1. On the BlockCart home page, select Create new rule. In the dialog, select Cart and checkout validation.
  2. Enter a Rule name. Choose Standard input under Rule input.
  3. Under Eligibility, select Only when conditions match. Set the first condition to Cart contains → at least one selected product. Select Select products and pick the products to restrict.
  4. Select Add condition (AND) in the same group. Choose Shipping country and is one of, then select Select countries, check the countries to block, and select Confirm. To restrict a state or ZIP instead, choose Province code or Zip code and enter the destination to block. Both conditions must match before the rule shows an error.
  5. Write an Error message that tells the customer what to change. Set Status to Live, then Save. Test the product and destination in Shopify checkout.

TODO screenshot: Standard input rule with Cart contains at least one selected product AND Shipping country is US

Restrict a collection by ZIP code

  1. Create another Cart and checkout validation rule. Choose Attribute input under Rule input.
  2. Select Only when conditions match. Set Cart contains to at least one product from collection(s), then use Select collections to pick the collection.
  3. Select Add condition (AND). Choose Zip code and is one of, then enter each blocked ZIP code on a separate line. Write the Error message, set Status to Live, and Save.

TODO screenshot: Attribute input rule with Cart contains at least one product from a collection AND Zip code is one of

Example

| Rule input | Conditions | Error message | | ------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | | Standard input | Cart contains → at least one selected product: selected product AND Shipping country is one of United States | This product cannot be shipped to the US. Remove it or change your shipping address. | | Attribute input | Cart contains → at least one product from collection(s): selected collection AND Zip code is one of 10001, 10002 | This collection cannot be shipped to your ZIP code. Remove those items or change your shipping address. |

Good to know

  • Shipping input offers collections under Cart contains, but has no shipping address fields. Attribute input offers collections, Zip code, and Shipping address (line 1), but has no Shipping country or Province code. You cannot restrict a collection by country or state with these conditions. As a workaround, give the collection's products a shared product tag. Then use Standard input with Cart contains → at least one product with tag(s) and Shipping country or Province code.
  • To restrict Shopify products by state, use Standard input with Province code. To restrict Shopify products by ZIP code, use Zip code with Standard input for products or Attribute input for collections.
  • One Shipping country condition can hold many countries. To allow the product only in some countries, use is not one of with the countries where it can ship.
  • Rule input is locked after you create the rule. Product and collection selections belong to your store; select them again if you import the rule into another store.

Related articles