Restrict Checkout

Restrict Checkout adds checkout rules to WooCommerce: a minimum order amount or quantity, a maximum order, blocked products or categories, regions you can’t ship to, payment method rules, and conditions for customer roles or purchase history. When an order breaks a rule, customers see your message telling them what to change, and the rules are enforced on the server in the classic checkout and the Checkout block. View the product page.

Quick start

↑ Back to top

Set a WooCommerce minimum order amount in five steps:

  1. Go to WooCommerce > Restrict Checkout and select Add checkout rule.
  2. Give the rule a title, such as “Minimum order $25”, and set Rule type to Cart amount.
  3. Tick Cart amount less than and enter 25.
  4. In Message shown to the customer, enter “Add {remaining_amount} more to check out. Our minimum order is {min_amount}.”
  5. Select Publish, then use the Simulator tab to check a small cart.
Get started with Restrict Checkout checklist with five steps

The Get started with Restrict Checkout checklist on the rules screen tracks the setup: create your first rule, write a helpful message, switch a rule on, test a cart in the simulator, and review the settings.

Installation

↑ Back to top

To start using a product from WooCommerce.com, you can 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.

Requirements

↑ Back to top
  • WordPress 6.5 or later.
  • WooCommerce 8.5 or later.
  • PHP 7.4 or later.

The plugin works with the Cart and Checkout blocks, the classic cart and checkout, and High-Performance Order Storage (HPOS). Messages can be translated with WPML String Translation and Polylang, and a wpml-config.xml file is included. Amount limits are converted for other currencies with WPML and WooCommerce Multilingual and Aelia Currency Switcher.

Setup and configuration

↑ Back to top

Restrict Checkout has three tabs under WooCommerce > Restrict Checkout: Rules, Simulator, and Settings. Users who can manage WooCommerce (administrators and shop managers) can manage rules.

Checkout rules

↑ Back to top

The rules list shows each rule’s type, what blocks checkout, and its priority. Use the Enabled switch to turn a rule on or off. Only rules that are on are enforced. You get a warning before a rule closes checkout for everyone.

Checkout rules list with five rules, their type, what blocks checkout, an on or off switch, and priority

Select Add checkout rule to create one. The editor has these sections.

What should this rule check

↑ Back to top
Rule type setting with Cart amount selected

Rule type decides what the rule checks:

  • Cart quantity: The number of items in the cart is below, above, or equal to a limit.
  • Cart amount: The cart amount is below, above, or equal to a limit (a minimum or maximum order amount).
  • Products in cart: The cart contains selected products.
  • Customers & user roles: Block checkout for guests, all logged-in customers, specific roles, or specific customers.
  • Product categories: The cart contains products from selected categories.
  • Purchase history: New buyers, amount spent, or items bought.
  • Region (country, state, postcode): Countries, states, or postcodes.
  • Custom conditions (AND / OR): Several conditions combined, including payment and shipping methods and coupons.

Cart quantity and cart amount

↑ Back to top
Cart quantity settings with greater than, less than, and equal to limits
  • Cart items quantity greater than, less than, and equal to: Tick a limit and enter the number. Each enabled limit blocks checkout on its own. For example, “less than 3” sets a minimum of 3 items.
Cart amount settings with less than 25 ticked and cart amount means subtotal before discounts
  • Cart amount greater than, less than, and equal to: For example, “less than 50” sets a minimum order amount of 50.
  • Cart amount means: Subtotal before discounts, excluding tax, Subtotal after coupons, excluding tax, or Order total, including tax and shipping.

Products and categories

↑ Back to top
Products in cart settings with restricted products
  • Restricted products: The products that block checkout.
  • Block only when ALL selected products are in the cart together: Otherwise any one of them blocks.
Product categories settings with restricted categories and include subcategories
  • Restricted categories: The categories that block checkout.
  • Block only when products from ALL selected categories are in the cart together: Otherwise any one category blocks.
  • Include subcategories: Products that are only in a child category also match.

Purchase history

↑ Back to top
Purchase history settings with amount spent, lifetime option, and spent limits
  • Check: Amount spent, New buyer (no paid orders yet), or Items bought.
  • Add up all orders (lifetime): When it’s off, only the largest single order is compared.
  • Spent greater than, less than, and equal to, or Order quantity greater than, less than, and equal to: The limits.

Completed and processing orders count. Logged-in customers are matched by account, and guests by billing email once they enter it at checkout.

Region

↑ Back to top
Region settings with countries, states, postcodes with wildcards and ranges, and the address to check

Checkout is blocked when the address matches every field you fill in. Leave a field empty to ignore it.

  • Countries: One or more countries.
  • States / counties: One per line or comma-separated. Use state codes (CA), names (California), or country:code (US:CA).
  • Postcodes / ZIP: One per line or comma-separated. Wildcards (902*) and ranges (90210…90299) work like WooCommerce shipping zones.
  • Address to check: Shipping address (billing address for carts that do not need shipping), Shipping address only, Billing address only, or Either address (block if billing OR shipping matches).

Custom conditions

↑ Back to top
Custom conditions with user role is any of Wholesale and cart subtotal is less than 300
  • Block checkout when: ALL conditions are true (AND) or ANY condition is true (OR).
  • Condition: Cart subtotal (before discounts), cart subtotal (after coupons), order total (incl. tax and shipping), cart item quantity, cart weight, products in cart, categories in cart, shipping classes in cart, user role, customer, customer is (a guest or logged in), country, state / county, postcode / ZIP, payment method, shipping method, coupon code, lifetime spend, or number of paid orders.
  • Operator: Depending on the condition: is less than, is at most, is greater than, is at least, is equal to, is not equal to, is any of, is none of, includes all of, or is not.
  • Country, state and postcode conditions check the: The address to use, as in Region rules.

Select Add condition to add more. Payment method conditions are checked when the customer places the order. Conditions that can’t be known yet, such as an address the customer hasn’t entered, never block.

Who does this rule apply to

↑ Back to top
Who does this rule apply to settings with customers, only these customers, and only these roles
  • Customers: Guests and registered customers, Registered customers only, or Guests only.
  • Only these customers and Only these roles: Registered customers are restricted when they match a selected role or are one of the selected customers. With none selected, every registered customer is restricted.

Message and priority

↑ Back to top
Message and priority settings with a message using remaining amount and minimum amount placeholders
  • Message shown to the customer: Select a placeholder to insert it: {rule_name}, {cart_total}, {cart_quantity}, {min_amount}, {max_amount}, {remaining_amount}, {min_quantity}, {max_quantity}, {remaining_quantity}, {customer_spent}, {country}, {state}, {postcode}, {products}, {categories}, {payment_method}, and {shipping_method}. {cart_subtotal} also works.
  • Priority: Lower numbers come first. All matching rules block checkout; their messages are listed in priority order, or only the first one (see Settings).

Settings

↑ Back to top
Restrict Checkout settings with when several rules block, cart notices, proceed to checkout button, and delete data on uninstall
  • When several rules block: Show every message (priority order) or Show only the highest-priority message.
  • Cart notices: Show restrictions in the cart and on the checkout page before the order is placed. Orders are always validated when they’re placed.
  • Proceed to checkout button: Hide “Proceed to checkout” in the classic cart while checkout is restricted.
  • Delete data on uninstall: Delete all checkout rules and settings when the plugin is deleted. Off by default.

How-to guides

↑ Back to top

How to set a minimum order amount in WooCommerce

↑ Back to top
  1. Create a Cart amount rule and tick Cart amount less than with your minimum.
  2. Choose what Cart amount means, for example the subtotal before discounts.
  3. Write a message with {remaining_amount} and {min_amount}, then publish the rule.

Customers see the message in the cart and at checkout, and can’t place the order until they reach the minimum.

Cart with the error Add $13.00 more to check out. Our minimum order is $25.00

How to set a minimum order quantity or maximum order quantity

↑ Back to top
  1. Create a Cart quantity rule.
  2. Tick Cart items quantity less than for a minimum, or greater than for a maximum, and enter the number.
  3. Use {min_quantity}, {max_quantity}, or {remaining_quantity} in the message.

How to set a minimum order for one customer role

↑ Back to top
  1. Create a Custom conditions rule with ALL conditions are true (AND).
  2. Add User role is any of the role, for example Wholesale.
  3. Add Cart subtotal (before discounts) is less than the minimum, for example 300.

Or use a Cart amount rule and choose the role in Only these roles.

How to block checkout by country, state, or postcode

↑ Back to top
  1. Create a Region (country, state, postcode) rule.
  2. Choose the Countries, and optionally the States / counties and Postcodes / ZIP.
  3. Choose the Address to check.

To allow checkout only for some countries, create a Custom conditions rule with Country is none of and select the countries you allow.

How to restrict payment methods

↑ Back to top
  1. Create a Custom conditions rule.
  2. Add Payment method is any of the method, for example Cash on delivery.
  3. Combine it with another condition, such as Order total (incl. tax and shipping) is greater than 200.

The order is blocked when the customer chooses that payment method and the other conditions are true. Shipping methods work the same way.

How to find out why checkout is blocked

↑ Back to top
  1. Go to WooCommerce > Restrict Checkout > Simulator.
  2. Choose a Registered customer or enter a Guest billing email, add products and quantities, coupon codes, the billing and shipping address, and the payment and shipping method.
  3. Select Check this cart.
Checkout simulator with customer, cart, address, payment, and shipping choices

Every enabled rule is listed with Blocks or Passes and the reason, together with the message the customer would see. Nothing is saved and no order is created.

Simulator result showing checkout would be blocked by the minimum order rule, with each rule's result and reason

Video

↑ Back to top

Frequently asked questions

↑ Back to top

Does it work with the Cart and Checkout blocks?

↑ Back to top

Yes. Rules are enforced through the Store API, the same way WooCommerce validates the cart, so the Checkout block shows the message and refuses the order. The classic checkout is enforced too.

Which address does a region rule check?

↑ Back to top

The shipping address when the cart needs shipping, otherwise the billing address. If that address is empty, the other one is used. You can change this per rule.

Do purchase history rules work for guests?

↑ Back to top

Yes. Guests are matched to their earlier orders by billing email once they enter it at checkout. Completed and processing orders count.

Which rule wins when several match?

↑ Back to top

All matching rules block checkout. Their messages are shown in priority order, or only the first one if you choose that in Settings.

Can I set a maximum order amount?

↑ Back to top

Yes. Create a Cart amount rule and tick Cart amount greater than. Use {max_amount} in the message.

Is data deleted when I delete the plugin?

↑ Back to top

Only if you turn on Delete data on uninstall in Settings. It’s off by default.

Troubleshooting

↑ Back to top

Checkout is blocked and I don’t know why

↑ Back to top

Use the Simulator with the same customer, products, and address. Each rule shows whether it blocks and why.

A rule doesn’t block checkout

↑ Back to top
  • Check that the rule’s Enabled switch is on and the rule is published, not a draft.
  • Check Who does this rule apply to. A rule for registered customers doesn’t apply to guests.
  • Conditions that can’t be known yet, such as an address the customer hasn’t entered, never block. Payment method conditions are checked when the order is placed.

Checkout is closed for everyone

↑ Back to top

A rule with no conditions that limit it blocks every customer. Switch it off in the rules list, or change who it applies to.

Known limitations

↑ Back to top
  • In the simulator, amounts use product prices without tax, shipping, or coupon discounts. A rule based on Order total (incl. tax and shipping) can pass in the simulator but block at the real checkout. Test those rules with a real cart.
  • In the rules list and the simulator’s reasons, some conditions show internal values, such as “cod” instead of “Cash on delivery”.
  • In the condition builder, long condition names are cut off in the select field.
  • {cart_subtotal} works in messages but has no insert button.

Developer notes

↑ Back to top

All hooks are filters.

  • rcw_restriction_message ($message, $rule, $vars, $context): The message of one rule.
  • rcw_cart_restrictions ($messages, $results, $context): All messages for the current cart.
  • rcw_threshold_amount ($amount, $rule): Convert amount limits for other currency switchers.
  • rcw_purchase_history_order_statuses ($statuses): Order statuses that count. Default completed and processing.
  • rcw_purchase_history_stats ($stats, $user_id, $email): Provide purchase history from another source.
  • rcw_purchase_history_include_guests ($include): Whether guests are matched by billing email.
  • rcw_rule_capability ($capability): The capability needed to manage rules. Default manage_woocommerce.

Works great with

↑ Back to top

Support

↑ Back to top

Need help? Contact WooCommerce.com support for Restrict Checkout. Include your WordPress, WooCommerce, and plugin versions and a screenshot of the simulator result.

Related Products

WooCommerce Subscriptions is a WooCommerce extension that lets customers subscribe to your products or...

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

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.