Calculators
Performing calculations with Calculators in Umbraco Commerce.
Defining a Custom Calculator Implementation
public class MyProductCalculator : ProductCalculator
{
public MyProductCalculator(ITaxService taxService, IStoreService storeService)
: base(taxService, storeService)
{ }
public override TaxRate CalculateProductTaxRate(IProductSnapshot productSnapshot, TaxSource taxSource, TaxRate fallbackTaxRate)
{
// Do custom tax rate calculation here
}
public override Price CalculateProductPrice(IProductSnapshot productSnapshot, Guid currencyId, TaxRate taxRate)
{
// Do custom price calculation here
}
}
Registering a custom Calculator implementation
Last updated
Was this helpful?