Single-unit listings
Each Unit has a stock number. When the unit sells, mark it Sold in the admin — it disappears from the storefront automatically.
Parts & accessories (Parts module)
Each Product has a numeric stockQty. When a customer places an order:
- We check
stockQty >= quantitybefore accepting checkout. - On payment, we decrement
stockQtyatomically. - When
stockQty == 0, the storefront shows "Out of stock" and the Add-to-cart button is disabled.
Variants
If a product has variants (sizes, colors), stock is tracked per variant. The base stockQty is ignored.
Low-stock alerts
A bell notification fires when any product crosses your low-stock threshold (default 3). Change the threshold in Settings → Store.
Common gotcha
If you decrement stock manually in the database, the storefront won't recalc until the next page load. Always update via the admin UI — it busts the right caches.