Guides / WooCommerce
How to set a minimum order amount in WooCommerce
Small orders cost more to pick, pack and ship than they earn. A shop that sells to businesses, or ships heavy goods, often needs a floor: "orders start at $50". WooCommerce does not have a setting for it. Here are the two ways to add one, and how to choose.
What WooCommerce does itself
Nothing. You can set free-shipping thresholds and flat rates, but there is no option that refuses an order below an amount. You need a code snippet or a plugin.
Option 1: a code snippet
This goes in a small custom plugin or your child theme's functions.php. It checks the cart subtotal, shows a notice, and stops the checkout while the cart is under the minimum. Change the number on the first line.
add_action( 'woocommerce_check_cart_items', function () {
$minimum = 50;
$total = WC()->cart->get_displayed_subtotal();
if ( $total < $minimum ) {
wc_add_notice(
sprintf( 'Orders start at %s. Add %s more to check out.',
wc_price( $minimum ), wc_price( $minimum - $total ) ),
'error'
);
}
} );
Notes on the snippet:
- It runs on the cart and checkout pages, so the customer sees the message before paying. Test it on both your classic and block checkout; if you use blocks and the message does not stop the order, you need a plugin that supports them.
get_displayed_subtotal()ignores shipping. Use the cart total instead if discounts should count toward the minimum.- It applies to every customer. For "trade accounts only", add a check on
current_user_can()or the user role inside the function. - If you edit it wrongly, the site can break. Keep a copy of the file before you change it.
Option 2: a rule in Tadrik Checkout Rules
The feature is free while we launch. Tadrik Checkout Rules is a free plugin on WordPress.org. Under WooCommerce > Checkout Rules, add a rule with the action "Stop the order with a message" and the condition "Cart total is less than 50". Or start from the ready-made rule "A minimum order".
The message can use {threshold}, {missing} and {cart_total}, so the customer sees the exact amount that is missing. The rule works with the block checkout and the classic one.
Because the condition is a normal rule condition, you can add more of them. A minimum only for guests, only for one country, or only when the cart holds a particular product category are all the same rule with one more condition.
Which should you pick?
- Snippet: one fixed number for everyone, and you are comfortable editing code.
- Plugin: different minimums for different customers or countries, you want to test a cart before going live, or you want to switch the rule off without touching code.
Test it before customers do
Whichever route you take, put three carts through: one below the minimum, one exactly at it, and one above. Do it logged out and logged in as a trade customer. In Checkout Rules, the Test a cart tab does this without placing an order, and shows which rule stopped the cart and why.
Common questions
Does WooCommerce have a minimum order amount setting? No. There is no built-in setting. You add one with a code snippet or a plugin.
Should the minimum include shipping and tax? That is your choice. Most shops count the items only, so a customer cannot reach the minimum by choosing expensive shipping. The snippet above uses the subtotal; in Checkout Rules the condition is on the cart total.
Can I set a minimum for wholesale customers only? Yes. With a snippet, check the user's role. In Checkout Rules, add a customer-role condition to the rule.
What if I also want a minimum quantity per product? That is a different limit. See minimum and maximum order quantities in WooCommerce.
Tadrik Checkout Rules
Stop orders below your minimum with a message that says exactly what is missing. Free on WordPress.org.
See Tadrik Checkout Rules