> ## Documentation Index
> Fetch the complete documentation index at: https://codebeans-cb-checkout-rules.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Common rule settings

> Settings that most rules share: countries, shipping or billing address, and checkout behavior.

Most rules share the same few settings. This page explains each one. Settings that belong to a single rule are explained on that rule's page.

## Countries

The first **Validate in** setting controls which orders the rule checks, based on the **shipping country**.

* **All countries**: the rule checks every order.
* **Specific countries**: the rule only checks orders shipped to the countries you select. Search for a country, tick it, and it appears in the **Allowed Countries** box. Click the **×** on a country to remove it, or **Clear all** to start again.

If you choose **Specific countries**, you must select at least one country before you can save.

> [!NOTE]
>
> The country filter always uses the shipping country, even when the rule checks the billing address.

> [!NOTE]
>
> **Character Count Limit** and **Keyword Matching Rule** don't have a country setting. They check every order.

## Shipping or billing address

The second **Validate in** setting controls which address the rule checks:

* **Shipping address** (the default)
* **Billing address**
* Both, if you tick both boxes

The error message appears next to the matching field in the address you chose.

For **Character Count Limit**, **Keyword Matching Rule** and **Regex Matching Rule**, you choose shipping or billing separately for each field you add.

## Checkout behavior

The **Checkout behavior** card on the right side of the editor has two options.

> [accordion] Validate on add-to-cart
>
> Off by default. When it is on, the rule also runs when the customer adds to or changes their cart, so problems are caught before checkout.
>
> Some details, such as the shipping address, are usually not known until checkout. Rules that depend on them won't find a problem at the cart stage, but they still run at checkout.

> [accordion] Allow checkout if the app has an error
>
> On by default. If Shopify can't run the rule for any reason, customers can still place their order.
>
> Turn it off only if it is more important to block an order than to risk losing a sale. With it off, Shopify blocks the checkout whenever it can't run the rule.

## Saving and discarding changes

* Click **Save** to save your changes. A message confirms that the rule was saved.
* Click **Discard** to undo your changes and go back to the last saved version.
* If something is missing, such as the English error message, the app shows what to fix and doesn't save.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.