ProductVariantPriceSelectionStrategy

ProductVariantPriceSelectionStrategy

The strategy for selecting the price for a ProductVariant in a given Channel.

Signature

interface ProductVariantPriceSelectionStrategy extends InjectableStrategy {
  selectPrice(
        ctx: RequestContext,
        prices: ProductVariantPrice[],
    ): ProductVariantPrice | undefined | Promise<ProductVariantPrice | undefined>;
}

Extends

Members

selectPrice

method
type:
(ctx: RequestContext, prices: ProductVariantPrice[]) => ProductVariantPrice | undefined | Promise<ProductVariantPrice | undefined>

DefaultProductVariantPriceSelectionStrategy

The default strategy for selecting the price for a ProductVariant in a given Channel. It first filters all available prices to those which are in the current Channel, and then selects the first price which matches the current currency.

Signature

class DefaultProductVariantPriceSelectionStrategy implements ProductVariantPriceSelectionStrategy {
  selectPrice(ctx: RequestContext, prices: ProductVariantPrice[]) => ;
}

Implements

Members

selectPrice

method
type:
(ctx: RequestContext, prices: ProductVariantPrice[]) =>