Confidential work · Ordering rules

Enforcing quantity limits and pack sizes in WooCommerce

A quantity-rule plugin with minimums, maximums and ordering multiples, backed by basket validation and product-specific overrides.

Illustration of grouped product packs passing through a quantity control gate.
Original technical illustration of the workflow. Client interfaces and data are not shown.

This is one of four plugins I built for the same confidential engagement. The other case studies cover different parts of that work.

The requirement

A store may sell products in packs, require a minimum quantity or limit how much can be ordered. Adjusting a quantity input helps customers choose, but the basket also needs to enforce the rules. I built a plugin that connects the visible controls to the ordering checks.

What I built

  • Built default minimum, maximum and step-multiple rules with product and variation overrides.
  • Applied quantity hints to product inputs and supplied the relevant rules when a customer selects a variation.
  • Validated add-to-basket and basket updates, accounting for quantities already in the basket when checking maximums.
  • Added full-basket minimum checks before checkout, configurable notices and Store API quantity-multiple support.

Help the customer choose a valid quantity

The product input reflects the applicable minimum, maximum and ordering step. Variation-specific data updates those controls when the customer changes their selection, so the interface can guide them towards an allowed quantity.

Store defaults keep the general policy in one place, while overrides handle products and variations that need different limits.

Enforce the rule beyond the input

The plugin also validates quantities when a product is added and when the basket is updated. Maximum checks consider quantities already present, and the checkout check reviews the complete basket for minimum requirements.

Messages explain the relevant limit so the customer can correct the quantity. The implementation also exposes ordering multiples to the WooCommerce Store API, extending the rule beyond the traditional product input.

What this makes possible

The store has configurable ordering limits with both customer-facing guidance and basket validation. Pack sizes and quantity constraints become part of the ordering workflow rather than a note customers must remember.

Why the detail matters

This is a focused example of custom WooCommerce development: a small-looking requirement that touches products, variations, basket changes and checkout. Each of those entry points needs to understand the same ordering policy.

Other plugins I built as part of the same confidential work.

Need WooCommerce to enforce your ordering rules?

Send me the outline and any deadline. We can agree a useful first piece of work and a realistic timescale.

Talk to Adam about your project