Checkout rules and validation allows your WooCommerce store to restrict customers from checkout using custom conditional rules that validate your cart.
Installation
↑ Back to topThe simplest way to start using a product from WooCommerce.com is to use the “Add to store” functionality on the order confirmation page or the My subscriptions section in your account.
- Navigate to My subscriptions.
- Find the Add to store button next to the product you’re planning to install.
- Follow the instructions on the screen, and the product will be automatically added to your store.
Alternative options and more information at:
Managing WooCommerce.com subscriptions.
Setup and Configuration
↑ Back to topCreating rules
↑ Back to topTo create new rules please follow these steps:
- Go to: WooCommerce > Settings > Checkout rules and validation.
- Click on Add Custom Rule.
- Enter a name for the rule.
- Select conditions (view creating conditions below).
- Enter a message that will appear as an error message in the store, if the the condition is not met.
- Click on save rule.
- Activate the rule by ticking the checkbox on the main settings page.
- The rules are not global, so you have to add them to each product and if a product with said rule is in the cart that rule will be applied to the entire cart.
Example: Item quantity is larger 3.
If the item quantity is smaller than 3, the error message that you entered will show up in the shop.

Creating conditions
↑ Back to topYou can add a number of custom conditions in the add custom rule page. The checkout will only be allowed, when the conditions that you set are met. For example, if you create a condition Address Country Code contains US
the checkout will only be allowed if the country code
of the user contains US
, otherwise the error message that you choose for that condition will show up.

Properties
Name | Info | Example |
Address Country Code | The country code of the customer. | US |
Product Tags | Tags that any product in the cart has. | summer |
Product Title | A title that any product in the cart has. | backpack |
Cart Subtotal | The entire price of the cart in your currency. | 10 (don’t add a $ to this, the number is enough) |
Item Quantity | The quantity of a specific product. | 5 |
Cart Quantity | The number of items in the cart. | T |
User Role | The role of the user that wants to checkout. | admin |
Discount Codes used | The number of discount codes used | 2 |