PHP 8.2 security fixes end 31 Dec 2026 PHP 8.2 fixes end 31 Dec 2026 30 days left Update for $349

Documentation

Restrict Checkout

Current version 1.1.0, released 11 Nov 2026.

Buy now, $49 a year Plugin overview

Last updated 1 Dec 2026

Restrict Checkout stops the orders you don't want before they're placed: below a minimum amount or quantity, above a maximum, with products you can't send to a region, or with a payment method that doesn't suit the order. Rules can depend on customer roles and purchase history. The customer sees your message saying exactly what to change, and every rule is checked on the server in both the classic checkout and the Checkout block. This page covers writing rules, conditions, messages and testing. See what the plugin does.

Quick start

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.

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

Bought on wpkoders.com

  1. Sign in to your account on wpkoders.com and open Licences. Your licence key is there, and in your order email.
  2. Select Download to get the plugin zip.
  3. In WordPress, go to Plugins > Add New Plugin > Upload Plugin, choose the zip, select Install Now, then Activate.
  4. Paste your licence key when the plugin asks for it. Updates then arrive in your dashboard like any other plugin.

Bought on WooCommerce.com

  1. Buy the plugin on WooCommerce.com. It's added to your WooCommerce.com account straight away.
  2. Download the zip from My Account > Downloads on WooCommerce.com.
  3. In WordPress, go to Plugins > Add New Plugin > Upload Plugin, choose the zip, select Install Now, then Activate.
  4. Connect your store to your WooCommerce.com account (WooCommerce > Extensions), so updates arrive in your dashboard like any other plugin.

Update on a staging copy first if your store takes orders all day. Every release is listed in the changelog below.

Requirements

  • 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

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

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.

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

What should this rule check

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

  • 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 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

  • Restricted products: The products that block checkout.

  • Block only when ALL selected products are in the cart together: Otherwise any one of them blocks.

  • 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

  • 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

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

  • 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

  • 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

  • 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

  • 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.
  • Cart total, minimum order and the amount left to add before checkout

    Cart total, minimum order and the amount left to add before checkout

  • Cart message asking the customer to add $13.00 more to reach the minimum order

    Cart message asking the customer to add $13.00 more to reach the minimum order

  • Checkout notice explaining that a product can't be shipped to Hawaii

    Checkout notice explaining that a product can't be shipped to Hawaii

  • Checkout simulator listing each rule as Passes or Blocks with the reason

    Checkout simulator listing each rule as Passes or Blocks with the reason

How-to guides

How to set a minimum order amount in WooCommerce

  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.

How to set a minimum order quantity or maximum order quantity

  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

  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

  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

  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

  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.

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.

Video

Plays from YouTube (privacy-enhanced mode) when you press play. Captions are on in the player.
  1. WooCommerce minimum order amount
  2. Minimum orders and region rules
  3. Conditions and the checkout simulator
  4. Try it risk-free for 30 days
Read the transcript

Set a minimum order amount, and checkout enforces it for you. Without rules, tiny orders slip through and eat your margins. Stop orders that cost you money, before they're placed. Customers see exactly how much more to add, right in the cart. Minimum orders, wholesale minimums and payment limits, all in one list. Block orders you can't fulfil, like chilled cold brew to Hawaii. Combine states, products, roles, payment and shipping methods, with AND or OR. The checkout simulator shows which rule blocks a cart, and the exact message. Every order on your terms, with fewer problems to fix later. Restrict Checkout, by WPKoders. Try it risk-free for 30 days on WooCommerce.com. Your success, koded.

Frequently asked questions

Does it work with the Cart and Checkout blocks?

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?

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?

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?

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?

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?

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

Troubleshooting

Checkout is blocked and I don't know why

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

A rule doesn't block checkout

  • 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

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

  • 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

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

Support

Bought here, using the free Lite version, or a question before buying? Open a ticket with us: the developers who wrote the plugin reply within 1 business day.

Open a ticket

Bought on WooCommerce.com? Open your ticket in your WooCommerce.com account, where your licence is.

Changelog

Version 1.1.0
  • Improved Now requires WordPress 6.5 or later and WooCommerce 8.5 or later.
  • New Custom conditions rules: combine conditions with AND / OR and "is any of / is none of" operators, including payment method, shipping method, coupon, shipping class, cart weight, lifetime spend and number of orders.
  • New Message placeholders such as {min_amount}, {remaining_amount}, {min_quantity}, {country}, {products} and {payment_method}.
  • New Checkout simulator ("Why is checkout blocked?"): see which rule blocks a cart for a customer and address, and why.
  • New Enabled switch in the rules list, a "Blocks checkout when" summary column, and a warning before a rule closes checkout for everyone.
  • New Settings: show only the highest-priority message, turn cart notices off, hide "Proceed to checkout" in the classic cart, delete data on uninstall (off by default).
  • New Region rules accept several countries, state names or US:CA, and postcode wildcards and ranges; choose the address to check per rule.
  • New Cart amount rules can use the subtotal after coupons or the order total; category rules can include subcategories.
  • New Redesigned admin with a setup checklist, clearer rule editor sections and inline help.
  • New Translatable rule messages (WPML String Translation, Polylang) and multi-currency limits (WPML/WCML, Aelia).
  • Fixed Region rules check the shipping address when the cart needs shipping, as documented. Previously the billing address was checked first, so a blocked shipping address could get through.
  • Fixed Purchase-history rules now apply to guests (matched by billing email) and to customers without paid orders.
  • Fixed Rules switched to draft, scheduled or deleted outside the editor (bulk edit, scheduled publishing, permanent delete) take effect immediately.
  • Fixed The classic checkout page now shows why checkout is blocked instead of only a generic notice.
  • Fixed No restriction notice on an empty block cart; rules are also enforced for checkouts that run through admin-ajax.
  • Improved Purchase history uses one cached query per customer and rules are evaluated once per request.
  • Improved New filters rcw_threshold_amount, rcw_restriction_message, rcw_cart_restrictions, rcw_purchase_history_include_guests and rcw_purchase_history_stats.
Version 1.0.3
  • Security Only users who can manage WooCommerce can create, edit or publish checkout rulesets. Authors could previously publish a ruleset that blocked every checkout.
  • Security The customer search used in rulesets is limited to store managers (it previously exposed customer names to Contributors).
  • Improved New filter rcw_rule_capability.
  • Improved Tested up to WordPress 7.1 and WooCommerce 11.2.
Version 1.0.2
  • Fixed Security — $_GET['revision'] in post updated messages is now sanitized with absint() before use.
  • Fixed Compatibility headers updated — Tested up to WordPress 7.0, WC tested up to 10.9 (verified on WP 7.0.2 / WC 10.9.4 / PHP 8.2+).
  • Fixed Region restriction now correctly requires all set fields (country, state, zipcode) to match — previously a country setting could block all orders regardless of state.
  • Fixed Purchase-history "amount spent" and "total quantity" calculations now exclude cancelled, refunded, failed, on-hold and pending orders; only completed and processing orders count (filterable via `rcw_purchase_history_order_statuses`).
  • Fixed Edit screen — previously-selected restricted categories were not pre-selected because the strict in_array compared int term_ids against string-typed meta values; meta values are now normalised to ints before comparison.
  • Fixed Edit screen — "Restrict Checkout for Customers" select would fatal on PHP 8 (`Attempt to read property "display_name" on bool`) when a saved customer had been deleted; deleted/invalid users are now skipped, and the display name is rendered with esc_html instead of esc_attr for HTML text content.
  • Fixed Edit screen — removed redundant in_array check inside the customers loop (every iterated user_id is by definition in the source array) so all stored customers render as selected.
  • Fixed User-roles list now resolves via `wp_roles()` with a method_exists guard instead of relying on the `$wp_roles` global, preventing a fatal when the global has not been initialised yet.
  • Fixed Status column on the Restrict Checkout list table read a non-existent meta key (`rcw_restrict_checkout_status`) and always rendered blank; it now shows the actual post status label.
  • Fixed restrict_by_products — product IDs from meta are coerced to ints before the missing-from-cart array_diff so "all selected products required" logic compares like with like.
  • Fixed Critical bug — product restriction check always returned empty due to undefined variables; restricted products never blocked.
  • Fixed Added singleton pattern to all plugin classes to prevent double instantiation.
  • Fixed Replaced old is_plugin_active() WooCommerce detection with class_exists('WooCommerce').
  • Fixed Version constant RCW_VERSION added; asset versions updated to use it.
  • Fixed Tested up to: 6.9, WC tested up to: 10.7.0.
  • Fixed All else if replaced with elseif per WordPress Coding Standards.
  • Fixed Strict comparison operators added throughout.
  • Fixed in_array() calls updated with strict true flag.
  • Fixed esc_attr() replaced with esc_html() for HTML text content in option elements.
  • Fixed Integer arguments in sprintf() use (int) cast instead of esc_attr().
  • Fixed Admin notice uses printf with proper escaping instead of pre-escaped class string.
  • Fixed Critical — multiple-ruleset evaluation no longer clobbers earlier matches; restrictions from every violated ruleset are merged and de-duplicated instead of overwriting.
  • Fixed Critical — quantity/price/order-amount/order-quantity rules now evaluate greater-than, less-than and equal-to as independent OR conditions; the previous range check used && and would never trigger when all three were enabled.
  • Fixed Critical — restrict_by_purchase_history could return a bool true when purchase_history was empty, causing TypeError on later foreach; now always returns array and exits early.
  • Fixed Critical — max() on empty arrays inside purchase-history checks would throw ValueError on PHP 8; now guarded.
  • Fixed Critical — order-quantity rule was comparing per-line-item quantity instead of total-items-per-order; now sums quantities per order.
  • Fixed Critical — Cart & Checkout Blocks validation hook switched from too-late "woocommerce_store_api_checkout_order_processed" (fires after order creation) to "woocommerce_store_api_cart_errors" with proper WP_Error population, so block-based checkout is actually prevented.
  • Fixed Float equality on cart subtotal vs. "equal to" price now uses epsilon comparison (abs diff < 0.005) instead of ===, which would never match due to FP precision.
  • Fixed Cart subtotal now falls back to summing line_subtotal/quantity*price when WC()->cart->get_subtotal() returns 0 before totals are calculated.
  • Fixed restrict_by_products now safely handles missing products_logic key, empty arrays and adds variation_id matching so variable products are not bypassed.
  • Fixed restrict_by_certain_categories now safely handles missing categories_logic key and short-circuits the multi-category loop once all required categories are matched.
  • Fixed restrict_by_region now handles both array and string storage of the country value (older saves stored a string); states/zipcodes also tolerate either format.
  • Fixed rcw_restrict_users_and_roles now coerces customers/roles to arrays before in_array/array_intersect, preventing PHP 8 TypeError when the meta is an empty string.
  • Fixed rcw_search_users AJAX endpoint now requires edit_posts capability in addition to the nonce check.
  • Fixed rcw_show_title_error now only runs on the restrict-checkout post type screen.
  • Fixed Restriction message now saved with sanitize_textarea_field so line breaks are preserved.
  • Fixed Country meta save normalised to an array of country codes so the admin select and frontend region check share one format.
  • Fixed rcw_cats_logical_condition default no longer mismatches type (was assigning array() and saving '').
  • Fixed wp_enqueue_style for backend now passes array() instead of '' for $deps (PHP warning).
  • Fixed $_GET['revision'] now sanitized with absint() after wp_unslash in post updated messages.
  • Fixed rcw_check_cart_items no longer requires is_cart()/is_checkout() conditional tags, which fail under Store API/REST contexts.
  • Fixed Duplicate restriction messages from multiple rulesets are now de-duplicated before display.
Version 1.0.1
  • Fixed Partial bug fixes for cart restriction evaluation.
Version 1.0.0
  • Improved Initial release.

Every release

Plugin releases and store tips, once a month

New releases, update warnings and one fix worth making.

One short email a month at most. We send a confirmation link first, and every email has a one-click unsubscribe. Privacy policy