Class DefaultOrderGroupCalculator

The order group calculator

Inheritance
System.Object
DefaultOrderGroupCalculator
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Order.Calculator
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0
Syntax
public class DefaultOrderGroupCalculator : IOrderGroupCalculator

Constructors

DefaultOrderGroupCalculator(IOrderFormCalculator, IShippingCalculator, ITaxCalculator)

Creates a new instance of DefaultOrderGroupCalculator

Declaration
public DefaultOrderGroupCalculator(IOrderFormCalculator orderFormCalculator, IShippingCalculator shippingCalculator, ITaxCalculator taxCalculator)
Parameters
Type Name Description
IOrderFormCalculator orderFormCalculator

The order form calculator

IShippingCalculator shippingCalculator

The shipping calculator

ITaxCalculator taxCalculator

The tax calculator

Methods

CalculateHandlingTotal(IOrderGroup)

Calculate the handling total for the order group

Declaration
protected virtual Money CalculateHandlingTotal(IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group

Returns
Type Description
Money

The handling total of the order group

Remarks

Gets the result by looping over all order forms and calling OrderFormCalculator.GetHandlingTotal

CalculateSubTotal(IOrderGroup)

Calculate the subtotal for the order group

Declaration
protected virtual Money CalculateSubTotal(IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group

Returns
Type Description
Money

The subtotal of the order group

Remarks

Gets the result by looping over all order forms and calling OrderFormCalculator.GetSubTotal

CalculateTotal(IOrderGroup)

Gets the total for the order.

Declaration
protected virtual Money CalculateTotal(IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group

Returns
Type Description
Money

The total for the order group

Remarks

Formula: GetSubTotal + GetHandlingTotal + ShippingCalculator.GetShippingCost + TaxCalculator.GetTaxTotal

Examples

GetHandlingTotal(IOrderGroup)

Calculate the handling total for the order group

Declaration
public Money GetHandlingTotal(IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group

Returns
Type Description
Money

The handling total of the order group

Remarks

Gets the result by looping over all order forms and calling OrderFormCalculator.GetHandlingTotal

Exceptions
Type Condition
System.ComponentModel.DataAnnotations.ValidationException

Thrown when calculation fails

GetOrderDiscountTotal(IOrderGroup, Currency)

Gets the order discount price.

Declaration
public Money GetOrderDiscountTotal(IOrderGroup orderGroup, Currency currency)
Parameters
Type Name Description
IOrderGroup orderGroup

The order.

Currency currency

The currency.

Returns
Type Description
Money

The order discount price

GetSubTotal(IOrderGroup)

Gets the total of extended prices for all line items in the order.

Declaration
public Money GetSubTotal(IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group

Returns
Type Description
Money

The total of extended prices for all line items in the order.

Remarks

Gets the result by looping over all order forms and calling OrderFormCalculator.GetSubTotal

Examples
Exceptions
Type Condition
System.ComponentModel.DataAnnotations.ValidationException

If validation fails.

GetTotal(IOrderGroup)

Gets the total for the order.

Declaration
public Money GetTotal(IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group

Returns
Type Description
Money

The total for the order group

Remarks

Formula: GetSubTotal + ShippingCalculator.GetShippingCost + TaxCalculator.GetTaxTotal

Examples
Exceptions
Type Condition
System.ComponentModel.DataAnnotations.ValidationException

If validation fails.

ValidateHandlingTotal(Money)

Validates the handling total

Declaration
protected virtual void ValidateHandlingTotal(Money money)
Parameters
Type Name Description
Money money

The calculated value

Exceptions
Type Condition
System.ComponentModel.DataAnnotations.ValidationException

If validation fails.

ValidateSubTotal(Money)

Validates the sub total

Declaration
protected virtual void ValidateSubTotal(Money money)
Parameters
Type Name Description
Money money

The calculated value

Exceptions
Type Condition
System.ComponentModel.DataAnnotations.ValidationException

If validation fails.

ValidateTotal(Money)

Validates the total

Declaration
protected virtual void ValidateTotal(Money money)
Parameters
Type Name Description
Money money

The calculated value

Exceptions
Type Condition
System.ComponentModel.DataAnnotations.ValidationException

If validation fails.

Implements