Checkout rules and validation

Checkout rules and validation allows your WooCommerce store to restrict customers from checkout using custom conditional rules that validate your cart.

Installation

↑ Back to top

The 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.

  1. Navigate to My subscriptions.
  2. Find the Add to store button next to the product you’re planning to install.
  3. 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.

Adding a WooCommerce.com subscription to your store

Setup and Configuration

↑ Back to top

Creating rules

↑ Back to top

To create new rules please follow these steps:

  1. Go to: WooCommerce > Settings > Checkout rules and validation.
  2. Click on Add Custom Rule.
  3. Enter a name for the rule.
  4. Select conditions (view creating conditions below).
  5. Enter a message that will appear as an error message in the store, if the the condition is not met.
  6. Click on save rule.
  7. Activate the rule by ticking the checkbox on the main settings page.
  8. 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 top

You 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

NameInfoExample
Address Country CodeThe country code of the customer.US
Product TagsTags that any product in the cart has.summer
Product TitleA title that any product in the cart has.backpack
Cart SubtotalThe entire price of the cart in your currency.10 (don’t add a $ to this, the number is enough)
Item QuantityThe quantity of a specific product.5
Cart QuantityThe number of items in the cart.T
User RoleThe role of the user that wants to checkout.admin
Discount Codes usedThe number of discount codes used2

Related Products

Offer add-ons like gift wrapping, special messages or other special options for your products.

Add shipment tracking information to your orders.