Skip to main content

MixStockHandler

Handling all stock methods and computed Data: defaultStock: { totalStock: 0, inStock: 0, oversellable: 0, static: 0, incoming: null } quantity: 1

Methods

MethodDescriptionParameters
getStockStatusGet stock status. Argument stock defaults to this.currentStock. Available statuses are: 'OUT_OF_STOCK', 'IN_STOCK', 'FEW_LEFT', 'OVERSELLABLE', 'STATIC'stock (Number)
getStockStatusTextGet stock status lang key. Argument stock defaults to this.currentStockstock (Object)
getStockStatusDeliveryTimeGet stock status lang key. Argument stock defaults to this.currentStockstock (Object)
getStockStatusClassGet stock status in kebab-case. Argument stock defaults to this.currentStockstock (Object)

Computed

ComputedTypeDescriptionFrom Store
currentStockNumberReturns value of data variable 'stock'. Made to be overwritten by the contextNo
stockStatusStringReturns a stock status. Available statuses are: 'OUT_OF_STOCK', 'IN_STOCK', 'FEW_LEFT', 'OVERSELLABLE', 'STATIC'No
stockStatusTextStringReturns stock status text content based on stock statusNo
chosenSkuCartQuantityNumberReturns the number of items with same skuId as the chosen one that you have in cartNo
stockThresholdNumberReturns the quantity left in stock subtracting items in cartNo
outOfStockBooleanReturns true if product is out of stockNo