ChangedPriceHandlingStrategy
ChangedPriceHandlingStrategy
This strategy defines how we handle the situation where an OrderItem exists in an Order, and then later on another is added but in the mean time the price of the ProductVariant has changed.
By default, the latest price will be used. Any price changes resulting from using a newer price
will be reflected in the GraphQL OrderLine.unitPrice[WithTax]ChangeSinceAdded
field.
Signature
interface ChangedPriceHandlingStrategy extends InjectableStrategy {
handlePriceChange(
ctx: RequestContext,
current: PriceCalculationResult,
existingItems: OrderItem[],
order: Order,
): PriceCalculationResult | Promise<PriceCalculationResult>;
}
Extends
Members
handlePriceChange
(ctx: RequestContext, current: PriceCalculationResult, existingItems: OrderItem[], order: Order) => PriceCalculationResult | Promise<PriceCalculationResult>