Low-stock warnings trigger at configured thresholds
Why it matters
With no low-stock signal, shoppers who would convert under urgency keep browsing and abandon, while a hardcoded threshold of 1 fires too late to move units before the SKU goes dark. The inverse failure — fabricated urgency with no real threshold — draws FTC scrutiny under scarcity-claim rules. Either way, a missing or non-configurable threshold hands revenue back to competitors and blocks the merchandising team from tuning behavior per category.
Severity rationale
Low because the impact is conversion-rate loss and merchandising inflexibility, not a security or data-integrity failure.
Remediation
Read the threshold from an environment variable so ops can tune it per deployment, then gate the warning on positive stock to avoid rendering 'Only 0 left' messages. Put the logic in src/lib/inventory.ts and consume it from every product card:
const LOW_STOCK_THRESHOLD = parseInt(process.env.LOW_STOCK_THRESHOLD ?? '5', 10)
if (product.stock > 0 && product.stock <= LOW_STOCK_THRESHOLD) {
return { ...product, lowStockWarning: `Only ${product.stock} left in stock` }
}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Catalog & Product Logic Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-catalog·automated