WooCommerce 11.2 Adds a Store API Filter for Cart Quantity Rules

If your shop limits how many of something a customer can buy, that rule may have quietly stopped working. WooCommerce 11.2 finally fixes it. How to check yours.

WooCommerce 11.2 Adds a Store API Filter for Cart Quantity Rules

If your WooCommerce shop has a cart quantity rule like two bottles per customer, or sells in cases of six, there is a decent chance that rule quietly stopped working when your checkout was updated. No error, no warning, just orders coming through that should not have. WooCommerce 11.2 adds the missing piece that lets us fix it properly. This is worth five minutes of checking even if you think you are fine.

What went wrong, in plain English

WooCommerce has had two generations of basket and checkout. The older one, and a newer one built from blocks that most shops have now moved to.

The older checkout had a way for us to say “reject this quantity and tell the customer why”. The new one did not. So when a shop moved across, any custom limit built on the old method simply stopped being applied. Nothing broke visibly. The limit just was not there any more.

That is the worst kind of fault, because nobody finds it on the website. It turns up in the warehouse, when someone notices an order for twelve of something that was supposed to cap at three.

What WooCommerce has added

The WooCommerce developer blog published the fix on 24 September 2026, adding a way to validate basket quantities in the new checkout. In their own words, the old basket had this and the new one had no equivalent. Now it does.

In practice it means a developer can once again set a rule, reject a quantity that breaks it, and show the customer a proper message explaining why, rather than the website silently accepting an order it should have refused.

For your developer, the short version

This part is for whoever maintains your site. If that is not you, skip to the next section, nothing is lost.

The new filter is woocommerce_store_api_cart_item_quantity_validation. Return a WP_Error to reject the change and the Store API sends the code and message back in a 400, which the block checkout shows to the shopper:

add_filter( 'woocommerce_store_api_cart_item_quantity_validation',
function ( $valid, $quantity, $product, $cart_item ) {
	if ( $quantity > 3 ) {
		return new \WP_Error(
			'invalid_custom_condition',
			sprintf( 'Only 3 of "%s" are allowed per order.', $product->get_name() )
		);
	}
	return $valid;
}, 10, 4 );

Two things to know. It runs after the built-in minimum, maximum and multiples checks. And it does not fire when a product is first added, only when a quantity is changed or the same product is added again. So this is one layer, not the whole answer.

We would also put this in a small site-specific plugin rather than the theme. Business rules should survive a redesign, and we have inherited more than one shop where the order limits vanished along with the old theme.

How to check your own shop in five minutes

You do not need a developer to find out whether you have a problem. Go to your own website as a customer would, add the product with the limit to your basket, then change the quantity to something above the limit and try to check out.

If it stops you with a clear message, you are fine. If it lets you through, the rule is not working and you have probably been taking orders you did not intend to accept. Try it both while logged in and as a guest, since those can behave differently.

While you are there, do it on your phone as well. Error messages in the new checkout have a habit of appearing somewhere nobody is looking on a small screen, and a limit that refuses to work with no visible explanation feels to a customer like a broken website rather than a policy. Clearing up friction like that is one of the simplest ways to increase online shop sales.

Where this matters most

Four situations come up again and again on the shops we look after. Limited stock on something scarce or on promotion, where the whole point is to stop one buyer taking the lot. Trade and wholesale accounts that have to order in case multiples. Age restricted or regulated products with a legal cap per order. And anything where more than a certain number will not physically fit in the courier’s box, which quietly makes your shipping quote wrong.

In every one of those, the rule already existed in the business. It was just being enforced somewhere fragile, often by a member of staff checking orders by hand. Moving it into the website properly removes a recurring manual job, which is usually the best value work you can do on an ecommerce site.

Worth doing at the same time

If you are booking developer time for this, it is worth pairing it with the PHP 8.1 change coming to WooCommerce in February. The testing is largely the same journey through your shop, so doing both in one go is considerably cheaper than doing them separately, and it keeps the disruption to one quiet morning rather than two. The PHP version is set by your host, so it is also a good moment to check your ecommerce hosting is up to the job.

Not sure whether your limits still work?

We are a small web agency in Sale, South Manchester, and this is exactly the sort of quiet fault we find on shops we take over. If you would like us to check whether your order limits are actually being applied, our WooCommerce team is happy to look. Get in touch and we will tell you honestly what we find.

FAQ

How do I know if this affects my shop?

Two questions. Does your shop use the newer block-based basket and checkout rather than the older style? And do you have any rule about how many of something a customer can buy? If both are yes, test it as a customer today. Plenty of shop owners assume a limit still works because it worked before the checkout changed.

We have a plugin that handles quantity limits. Are we covered?

Possibly, but do not assume. Plugins written for the old checkout often hook into something the new one never calls, so they appear to be configured correctly while doing nothing. Test the limit on your live checkout rather than trusting the plugin’s settings screen, and ask the developer whether they support the new checkout if it fails.

Can we show a different message for different products?

Yes. The rule can look at the product, so you can set different limits and different wording by category, by stock level, by price, or by a custom field. Keep the messages short and specific, because they appear inline in the basket where there is not much room, especially on a phone.

Can I set simple limits myself without a developer?

For straightforward caps, yes. WooCommerce has minimum, maximum and multiples settings on the product itself, and those still work and need no code. You only need a developer when the rule depends on the customer, the whole basket, or something the product settings cannot express.

Photo by rupixen on Unsplash

STRAND

Strand Creative is a web design and development studio in Sale, South Manchester. Twenty years, over 220 sites looked after, one team you can actually get hold of.

Keep reading

Shopify's January 2027 App Token Deadline: What Store Owners Need to Do

Shopify’s January 2027 App Token Deadline: What Store Owners Need to Do

Shopify has set 1 January 2027 as the deadline for app developers to move to expiring access tokens. Here is…

One Line in Robots.txt Now Tells AI Companies Not to Train on Your Site

One Line in Robots.txt Now Tells AI Companies Not to Train on Your Site

Google, Microsoft, OpenAI and Anthropic now back one robots.txt line to opt out of AI training. What __usage_ai-training does, and…

WordPress 7.1.4 Is a Security Release: Update Your Site Today

WordPress 7.1.4 Is a Security Release: Update Your Site Today

WordPress 7.1.4 landed on 28 October 2026 with 12 security fixes, including a remote code execution flaw. Here is what…

Got something you
want building?

Tell us what you need and we will be in touch.

Call us WhatsApp Get a quote
WhatsApp us