Skip to main content
Skip to main content

IPriceSelectionStrategy

internal.internal.IPriceSelectionStrategy

Implemented by

Methods

calculateVariantPrice

calculateVariantPrice(data, context): Promise<Map<string, PriceSelectionResult>>

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

Parameters

data{ quantity?: number ; variantId: string }[]Required
contextPriceSelectionContextRequired
Details relevant to determine the correct pricing of the variant

Returns

Promise<Map<string, PriceSelectionResult>>

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

onVariantsPricesUpdate(variantIds): Promise<void>

Notify price selection strategy that variants prices have been updated.

Parameters

variantIdsstring[]Required
The ids of the updated variants

Returns

Promise<void>

PromisePromise<void>Required

withTransaction

withTransaction(transactionManager?): IPriceSelectionStrategy

Parameters

transactionManagerEntityManager

Returns

IPriceSelectionStrategy

IPriceSelectionStrategyIPriceSelectionStrategyRequired

Inherited from

ITransactionBaseService.withTransaction

Was this section helpful?