Stock Management
Per-item stock tracking system that deducts stock on purchase and optionally restocks items on a configurable interval.
How It Works
- Enable stock management on individual products in the admin panel
- Set the initial stock amount for each item
- When a customer purchases an item, stock is deducted automatically
- If an item runs out of stock, it cannot be purchased until restocked
- Stock count is displayed on item cards in the shop UI
Features
- Per-Item Toggle: Stock tracking is enabled per product, not globally
- Purchase Validation: Server-side stock check before processing payment
- Grouped Deduction: Multiple quantities of the same item in a basket are grouped and deducted at once
- UI Indicator: Stock count shown on item cards when
showStockCountis enabled - Auto-Restock: Optional automatic restocking at configurable intervals
Configuration
| Option | Default | Description |
|---|---|---|
Config.Market.StockManagement.enabled | true | Enable the stock management system |
Config.Market.StockManagement.autoRestock | false | Automatically restock items |
Config.Market.StockManagement.restockInterval | 3600 | Restock interval in seconds (1 hour) |
Config.Market.UI.showStockCount | true | Show stock count on item cards |
