How to Restrict Checkout by Customer Shipping Country with CartBlock

This article provides a step-by-step guide on how to block specific customer shipping countries at checkout with CartBlock.
Written by Abhi Jain
Updated 1 week ago

In this tutorial, we'll guide you through the process of restricting customers' shipping countries during checkout using CartBlock by Nextools.

To begin, navigate to Validation Rules and click the Create button.

Once you select Create, a configuration window will appear asking you to choose a validation mode. For this tutorial, we will proceed with Basic Validation.

After choosing Basic Validation, you'll be directed to the validation setup page, which provides several customisation options.

The first step is to assign a Validation title. This title is for internal reference only and will help you manage your rules more efficiently.

Note: You can choose a validation title as per your choice

In the next step we will define the Error Message 

Next, determine where the validation should be applied. CartBlock offers three scopes: interactions with the cart, checkout completion and interaction within the checkout process. You can enable one, two or all three, depending on your requirements.

For example, we will enable completing the checkout and interacting with it.

Following this, decide which part of the checkout flow should be restricted. The app provides multiple points of control, but for this tutorial, we will apply the block at the Cart level.

Finally, configure a custom error message. This message will appear on the checkout page whenever a shopper tries to proceed with a shipping country that is restricted in their personal information.

In this step, you'll need to define the Function Input. This setting determines which data fields can be used to customise your rule.
Each Function Input offers more specific condition related to the Function Input title.

Since our goal is to restrict customers shipping, we can use the specific Shipping Input or, like in this case, we will select Standard Input.
Remember, the platform also provides additional options to give merchants greater flexibility.

Next, configure the conditions that will trigger this rule.

CartBlock allows you to set up to five conditions within a single validation rule. You can apply either AND or OR logic to determine how multiple conditions should work together.

Adding conditions is straightforward; simply click the button to reveal a drop-down menu of available options.

You can also select between "any" or "not any".

Country options!

For this tutorial, we'll keep it simple by creating a single condition: blocking the checkout for customers shipping in the UK, USA, or UAE. If a shopper selects any of these countries, their cart will be restricted.

As you configure conditions, a summary panel appears just below the Save button, providing a clear overview of the rules you've set.

Once you're done setting everything up, click Save to apply the rule.

This is how the functionality will work on the checkout of your store.

Activate any plan today and enjoy a 7-day free trial to explore all the features risk-free.

If you need further assistance, feel free to contact us via support email or connect with us directly through HelpCrunch

Did this answer your question?