ProductVariantPriceCalculationStrategy
ProductVariantPriceCalculationStrategy
Defines how ProductVariant are calculated based on the input price, tax zone and current request context.
info
This is configured via the catalogOptions.productVariantPriceCalculationStrategy
property of
your VendureConfig.
Signature
interface ProductVariantPriceCalculationStrategy extends InjectableStrategy {
calculate(args: ProductVariantPriceCalculationArgs): Promise<PriceCalculationResult>;
}
- Extends:
InjectableStrategy
calculate
method
(args: ProductVariantPriceCalculationArgs) => Promise<PriceCalculationResult>
ProductVariantPriceCalculationArgs
The arguments passed the calculate
method of the configured ProductVariantPriceCalculationStrategy.
The productVariant
argument was added in v2.1.0.
Signature
interface ProductVariantPriceCalculationArgs {
inputPrice: number;
productVariant: ProductVariant;
taxCategory: TaxCategory;
activeTaxZone: Zone;
ctx: RequestContext;
}