# Set a minimum order amount in WooCommerce

> Block checkout until the cart subtotal reaches a minimum, with a clear notice.

- Source: https://plugstack.dev/snippets/woocommerce-minimum-order-amount/
- Published by: PlugStack
- Last updated: 2026-09-24

```php
add_action( 'woocommerce_check_cart_items', function () {
	$minimum = 50; // Store currency.
	if ( WC()->cart && WC()->cart->get_subtotal() < $minimum ) {
		wc_add_notice(
			sprintf( 'Your order must be at least %s before checkout.', wc_price( $minimum ) ),
			'error'
		);
	}
} );
```
