Limit Orders per Delivery Time Slot
Cap WooCommerce orders per delivery time slot: why capacity beats guesswork, how counting works, race conditions at checkout and sensible slot sizes.

Offer delivery slots without a cap and you will discover the same thing every store does: roughly half your customers want Saturday between nine and twelve. The van cannot do it, the route planner improvises, and the promise you made at checkout becomes an apology by email. Setting a maximum number of orders per time slot is what turns a slot picker from a wish list into a schedule.
Capacity is a fulfilment number, not a marketing one
Work it out from the route, not from demand:
- Drops per hour. Urban routes with short distances manage more stops than rural ones; heavy or two-person deliveries manage far fewer.
- Slot length. A three-hour slot at six drops an hour is eighteen stops — before anything goes wrong.
- Buffer. Take off about 20% for traffic, re-attempts and the customer who is not in. A slot planned to the theoretical maximum overruns on the first bad day.
- Vans. Multiply by the number of vehicles genuinely running that slot, not the number you own.
Write the resulting number down per slot per weekday. Saturday morning is not Tuesday afternoon and should not share a cap.
How the counting works
Conceptually the rule is simple: for a given date and slot, count the orders that already hold it, and compare with the maximum.
```php function store_slot_booking_count( string $date, string $slot ): int { $orders = wc_get_orders( [ 'limit' => -1, 'status' => [ 'processing', 'on-hold', 'completed' ], 'return' => 'ids', 'meta_query' => [ [ 'key' => '_delivery_date', 'value' => $date ], [ 'key' => '_delivery_slot', 'value' => $slot ], ], ] );
return count( $orders ); } ```
Three decisions hide in that snippet. Which statuses count — include the ones that will be delivered, exclude cancelled, failed and refunded so their capacity returns to the pool. What you count — orders for van stops, items or preparation minutes for kitchens and workshops. And performance — a meta query over every order gets slow on a busy store, so a real implementation keeps a per-slot counter table rather than counting from scratch on every page load.
The race condition nobody tests
Two customers open the checkout while one place remains. Both see the slot; both submit. If availability is only evaluated when the calendar renders, both orders are accepted and you are over capacity.
The fix is to validate again during `woocommerce_checkout_process`, immediately before the order is created, and to fail the second attempt with a specific message: the slot just filled, please choose another. Silent acceptance is the worst outcome, because nobody finds out until the route is planned.
Configuring it without building it
Counters, status filters, per-weekday maximums and the re-check at checkout are a fair amount of code to own. Our Delivery Date & Timeslot for WooCommerce plugin provides slot capacity as a setting per slot and per weekday, greys out full slots in the calendar, and re-validates on submit — which is where the correctness actually lives.
It also pairs with the rules that decide which dates exist in the first place: lead times and cut-offs and blocked dates.
What customers should see
A full slot should be visible but unselectable, not missing. A greyed-out Saturday morning tells the customer the option exists and is popular, which sets expectations; an absent option looks like a bug and generates a support email asking whether you deliver on Saturdays at all.
Add a short line under the calendar explaining that slots fill up, and the number of complaints about "no slots available" drops noticeably.
Reviewing capacity with real data
After two weeks, compare planned drops per slot with actual completion times. The typical finding is that one or two slots are consistently over-ambitious while several sit half empty. Lower the tight ones, then consider a small incentive — free or cheaper delivery — on the quiet slots. Shifting demand is cheaper than adding a van.
FAQ
- How do I limit the number of orders per delivery time slot in WooCommerce?
- Store a maximum per slot, count the existing orders that already hold that slot, and hide or disable the slot once the count reaches the maximum. Re-check the count during checkout processing, not only when the calendar renders.
- What is a sensible capacity per slot?
- Start from route reality: drops per hour times slot length, minus a buffer of roughly 20% for traffic and re-attempts. Review it after two weeks of real routes rather than guessing once.
- Can two customers book the last slot at the same time?
- Yes, if you only check availability when the page loads. Validate again in woocommerce_checkout_process and reject the second order with a clear message asking the customer to pick another slot.
- Should slot capacity count orders or items?
- Count whatever constrains you. Van routes are constrained by stops, so count orders. Kitchen or assembly capacity is constrained by volume, so count items or preparation minutes instead.
- How do I release capacity from cancelled orders?
- Count only orders in statuses that will actually be delivered. Excluding cancelled, failed and refunded orders returns their capacity to the slot automatically.
This article is part of our WooCommerce delivery dates topic hub, where the related plugins and guides live together.


