Skip to main content
Skip to main content

IPriceSelectionStrategy

Methods

calculateVariantPrice

Calculate the original and discount price for a given variant in a set of circumstances described in the context.

Parameters

dataobject[]Required
contextPriceSelectionContextRequired
Details relevant to determine the correct pricing of the variant

Returns

PromisePromise<Map<string, PriceSelectionResult>>Required
pricing details in an object containing the calculated lowest price, the default price an all valid prices for the given variant

onVariantsPricesUpdate

Notify price selection strategy that variants prices have been updated.

Parameters

variantIdsstring[]Required
The ids of the updated variants

Returns

PromisePromise<void>Required

withTransaction

Parameters

transactionManagerEntityManager

Returns

calculateVariantPrice(data: { quantity?: number ; variantId: string }[], context: PriceSelectionContext) => Promise<Map<string, PriceSelectionResult>>Required
onVariantsPricesUpdate(variantIds: string[]) => Promise<void>Required
withTransaction(transactionManager?: EntityManager) => IPriceSelectionStrategyRequired
Was this section helpful?