Skip to main content

DefaultStockLocationStrategy

The DefaultStockLocationStrategy was the default implementation of the StockLocationStrategy prior to the introduction of the MultiChannelStockLocationStrategy. It assumes only a single StockLocation and that all stock is allocated from that location. When more than one StockLocation or Channel is used, it will not behave as expected.

Signature
  • Extends: BaseStockLocationStrategy

init

method(injector: Injector) =>

getAvailableStock

method(ctx: RequestContext, productVariantId: ID, stockLevels: StockLevel[]) => AvailableStock

forAllocation

method(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number) => LocationWithQuantity[] | Promise<LocationWithQuantity[]>
Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page