> For the complete documentation index, see [llms.txt](https://kb.craftformswp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.craftformswp.com/documentation/form-building/create-form/setting-up-booking-capacity-and-stock-limits.md).

# Setting Up Booking Capacity & Stock Limits

CraftForms can stop visitors from booking more people than you have room for, or buying more than you have in stock — and show them a message when that happens. This guide covers the settings involved and the dynamic tags you can use elsewhere in your form to reflect them.

These settings live on the **Catalog item** connected to your form. Go to **CraftForms → Catalog**, open the item, and look for the sections below.

***

### Booking capacity <a href="#booking-capacity" id="booking-capacity"></a>

Found under the **Booking** section of a booking-type catalog item.

#### Occupancy Model and Capacity <a href="#occupancy-model-and-capacity" id="occupancy-model-and-capacity"></a>

**Occupancy Model** has two options, and what **Capacity** means depends on both this setting and your booking type:

* **For a fixed time slot** (an appointment, class, or tour with specific times):
  * **Exclusive** — one booking takes the whole slot. Capacity is the number of people allowed in that one booking.
  * **Shared** — several separate bookings can share the same slot, as long as their combined number of people stays within Capacity.
* **For a day-based stay** (bookings with check-in/check-out dates, no fixed time):

  * **Exclusive** — Capacity is how many *separate bookings* can exist for the same date(s) — think "how many rooms/units," not "how many people."
  * **Shared** — the combined number of people across *all* bookings for a date must stay within Capacity.

  If you want a hard limit on how many people are allowed **in one booking** regardless of how many other bookings exist that day, keep Occupancy Model on Exclusive and set Capacity to that per-booking limit — this works automatically once you follow "Capping the number of people" below. If instead you want the *total* number of people across all bookings on a date to stay under a limit, use Shared.

#### Capacity Measure Variable <a href="#capacity-measure-variable" id="capacity-measure-variable"></a>

Enter the **field name** of your "number of people" field (for example: `participants`). This tells CraftForms which field represents party size, so it can be checked against Capacity.

#### Capping the number of people a visitor can enter <a href="#capping-the-number-of-people-a-visitor-can-enter" id="capping-the-number-of-people-a-visitor-can-enter"></a>

To automatically stop someone from entering more people than a slot or date allows:

1. Select your "number of people" field in the form editor.
2. Open its block settings and find the **Dynamic Validation** panel.
3. In **Max Value (expression)**, enter:

   ```
   _booking_capacity
   ```
4. *(Optional)* Open the **Validation Messages** panel and set **Maximum Value** to your own wording — this replaces the default "Value must be N or less."

Once this is set up (and Capacity Measure Variable above points to the same field), the limit updates itself automatically as the visitor picks a date or time slot — no further configuration needed.

***

### Product stock <a href="#product-stock" id="product-stock"></a>

Found under the **Inventory** section of a product-type catalog item.

* **Stock** — how many units are available. Leave this empty to disable stock tracking (unlimited).
* **Quantity Variable** — the field name of your "quantity" field, so CraftForms knows how many units are being requested. Leave empty if every order is always 1 unit.

Once Stock is set to a number, CraftForms automatically:

* Hides the Payment block entirely (showing an "out of stock" message instead) once Stock reaches 0.
* Double-checks stock right before the card is charged, if the form uses Stripe or PayPal directly inside the form (not the "redirect to Stripe/PayPal" option).
* Blocks the order if stock ever runs out — whether or not the form uses online payment at all.

The current Stock value is also available as a dynamic tag, **`_catalog_stock`** — this works the same way `_booking_capacity` does for bookings.

#### Capping the quantity field to available stock <a href="#capping-the-quantity-field-to-available-stock" id="capping-the-quantity-field-to-available-stock"></a>

1. Select your "quantity" field in the form editor.
2. Open its block settings and find the **Dynamic Validation** panel.
3. In **Max Value (expression)**, enter:

   ```
   _catalog_stock
   ```
4. *(Optional)* Open the **Validation Messages** panel and set **Maximum Value** to your own wording — this replaces the default "Value must be N or less."

This only appears once Stock (above) is set to a number — leaving Stock empty (unlimited) means there's nothing to cap against, so `_catalog_stock` stays unset and the quantity field keeps whatever maximum you've set yourself (or none).

#### Showing the stock level on the page <a href="#showing-the-stock-level-on-the-page" id="showing-the-stock-level-on-the-page"></a>

Use **`{{form.catalog_stock}}`** anywhere merge tags are supported — for example, inside an Infoblock — to show visitors how many units are left (e.g. "Only `{{form.catalog_stock}}` left!"). No extra setup needed beyond Stock being set.

Like Stock itself, this is a snapshot taken when the page loads — it won't update live if someone else buys the last units while your visitor is still filling out the form. The order is still safely blocked at submission either way (see above); this tag is for display, not enforcement.

***

### Showing a message to visitors <a href="#showing-a-message-to-visitors" id="showing-a-message-to-visitors"></a>

When a date/slot is no longer available, or stock has run out, right before payment is confirmed, CraftForms can show a message to the visitor — but only if a **Notification** block has been added to the form. Add one anywhere in the form to enable this.

Without a Notification block, this particular message is simply not shown — but the booking or order is still correctly blocked either way.

***

### WooCommerce-connected products <a href="#woocommerce-connected-products" id="woocommerce-connected-products"></a>

If your form is connected directly to a WooCommerce product rather than a CraftForms Catalog item:

* Regular WooCommerce stock (managed on the product itself, under its Inventory tab) is checked automatically when the order is placed, and also right before the card is charged if using Stripe/PayPal inside the form. There isn't currently an early, live re-check the moment stock changes the way there is for Catalog products, so visitors won't get an advance warning — the order is still safely blocked if stock has run out.
* If you use the per-option stock table (under the product's CraftForms (WooCommerce) settings → Stock), its current value is available as a smart variable named `wc_stock`. To show it on the page:
  1. Go to **Smart Variables** for that product.
  2. Find `wc_stock` and check **Expose as field variable**.
  3. Use `{{field.wc_stock}}` anywhere merge tags are supported — for example, inside an Infoblock.

***

### Quick reference <a href="#quick-reference" id="quick-reference"></a>

| What you want to do                                | Setting or tag            | Where to find it                                                                   |
| -------------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------------- |
| Define how many people/bookings are allowed        | Occupancy Model, Capacity | Catalog item → Booking                                                             |
| Tell CraftForms which field holds the people count | Capacity Measure Variable | Catalog item → Booking                                                             |
| Auto-limit the people-count field                  | `_booking_capacity`       | People field → Dynamic Validation → Max Value (expression)                         |
| Customize the "too many people" message            | —                         | People field → Validation Messages → Maximum Value                                 |
| Define how many units you have                     | Stock                     | Catalog item → Inventory                                                           |
| Tell CraftForms which field holds the quantity     | Quantity Variable         | Catalog item → Inventory                                                           |
| Show a "not available" / "out of stock" message    | Notification block        | Anywhere in the form                                                               |
| Show WooCommerce per-option stock on the page      | `{{field.wc_stock}}`      | Infoblock or other merge-tag text, after exposing `wc_stock` under Smart Variables |
