Skip to main content

Stock Management

Per-item stock tracking with automatic deduction and optional auto-restock

This section

Stock Management

Per-item stock tracking system that deducts stock on purchase and optionally restocks items on a configurable interval.

How It Works

  1. Enable stock management on individual products in the admin panel
  2. Set the initial stock amount for each item
  3. When a customer purchases an item, stock is deducted automatically
  4. If an item runs out of stock, it cannot be purchased until restocked
  5. 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 showStockCount is enabled
  • Auto-Restock: Optional automatic restocking at configurable intervals

Configuration

OptionDefaultDescription
Config.Market.StockManagement.enabledtrueEnable the stock management system
Config.Market.StockManagement.autoRestockfalseAutomatically restock items
Config.Market.StockManagement.restockInterval3600Restock interval in seconds (1 hour)
Config.Market.UI.showStockCounttrueShow stock count on item cards