DefaultStockDisplayStrategy
DefaultStockDisplayStrategy
Displays the ProductVariant.stockLevel as either 'IN_STOCK', 'OUT_OF_STOCK' or 'LOW_STOCK'.
Low stock is defined as a saleable stock level less than or equal to the lowStockLevel as passed in
to the constructor (defaults to 2).
Signature
class DefaultStockDisplayStrategy implements StockDisplayStrategy {
constructor(lowStockLevel: number = 2)
getStockLevel(ctx: RequestContext, productVariant: ProductVariant, saleableStockLevel: number) => string;
}
- Implements:
StockDisplayStrategy
constructor
method
(lowStockLevel: number = 2) => DefaultStockDisplayStrategygetStockLevel
method
(ctx: RequestContext, productVariant: ProductVariant, saleableStockLevel: number) => string