A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Class IOrderGroupExtensions

Extension methods for IOrderGroup.

Inheritance
System.Object
IOrderGroupExtensions
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
Assembly: EPiServer.Business.Commerce.dll
Version: 9.24.1
Syntax
public static class IOrderGroupExtensions

Methods

AddLineItem(IOrderGroup, ILineItem)

Adds the line item to the order group. Will use the first IOrderForm on orderGroup and create one if it does not exist. Will use the first IShipment on orderGroup.Forms and create one if it does not exist.

Declaration
public static void AddLineItem(this IOrderGroup orderGroup, ILineItem lineItem)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

ILineItem lineItem

The line item.

AddLineItem(IOrderGroup, ILineItem, IOrderFactory)

Adds the line item to the order group. Will use the first IOrderForm on orderGroup and create one if it does not exist. Will use the first IShipment on orderGroup.Forms and create one if it does not exist.

Declaration
public static void AddLineItem(this IOrderGroup orderGroup, ILineItem lineItem, IOrderFactory orderFactory)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

ILineItem lineItem

The line item.

IOrderFactory orderFactory

The order factory.

AddLineItem(IOrderGroup, IOrderForm, ILineItem)

Adds the line item to the specified order form. Will use the first IShipment on orderForm.Shipments and create one if it does not exist.

Declaration
public static void AddLineItem(this IOrderGroup orderGroup, IOrderForm orderForm, ILineItem lineItem)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IOrderForm orderForm

The order form.

ILineItem lineItem

The line item.

AddLineItem(IOrderGroup, IOrderForm, ILineItem, IOrderFactory)

Adds the line item to the specified order form. Will use the first IShipment on orderForm.Shipments and create one if it does not exist.

Declaration
public static void AddLineItem(this IOrderGroup orderGroup, IOrderForm orderForm, ILineItem lineItem, IOrderFactory orderFactory)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IOrderForm orderForm

The order form.

ILineItem lineItem

The line item.

IOrderFactory orderFactory

The order factory.

AddLineItem(IOrderGroup, IShipment, ILineItem)

Adds the line item to the order group for the specified shipment.

Declaration
public static void AddLineItem(this IOrderGroup orderGroup, IShipment shipment, ILineItem lineItem)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IShipment shipment

The shipment.

ILineItem lineItem

The line item.

AddPayment(IOrderGroup, IOrderForm, IPayment)

Adds the shipment to the specified order form.

Declaration
public static void AddPayment(this IOrderGroup orderGroup, IOrderForm orderForm, IPayment payment)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IOrderForm orderForm

The order form.

IPayment payment

The payment.

AddPayment(IOrderGroup, IPayment)

Adds the payment to the order group. Will use the first IOrderForm on orderGroup and create one if it does not exist.

Declaration
public static void AddPayment(this IOrderGroup orderGroup, IPayment payment)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IPayment payment

The payment.

AddPayment(IOrderGroup, IPayment, IOrderFactory)

Adds the payment to the order group. Will use the first IOrderForm on orderGroup and create one if it does not exist.

Declaration
public static void AddPayment(this IOrderGroup orderGroup, IPayment payment, IOrderFactory orderFactory)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IPayment payment

The payment.

IOrderFactory orderFactory

The order factory.

AddShipment(IOrderGroup, IOrderForm, IShipment)

Adds the shipment to the specified order form.

Declaration
public static void AddShipment(this IOrderGroup orderGroup, IOrderForm orderForm, IShipment shipment)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IOrderForm orderForm

The order form.

IShipment shipment

The shipment.

AddShipment(IOrderGroup, IShipment)

Adds the line item to the order group. Will use the first IOrderForm on orderGroup and create one if it does not exist.

Declaration
public static void AddShipment(this IOrderGroup orderGroup, IShipment shipment)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IShipment shipment

The shipment.

AddShipment(IOrderGroup, IShipment, IOrderFactory)

Adds the line item to the order group. Will use the first IOrderForm on orderGroup and create one if it does not exist.

Declaration
public static void AddShipment(this IOrderGroup orderGroup, IShipment shipment, IOrderFactory orderFactory)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IShipment shipment

The shipment.

IOrderFactory orderFactory

The order factory.

AdjustInventoryOrRemoveLineItems(IOrderGroup, Action<ILineItem, ValidationIssue>)

Adjusts the inventory for IOrderGroup or removes the line item if no available inventory.

Declaration
public static void AdjustInventoryOrRemoveLineItems(this IOrderGroup orderGroup, Action<ILineItem, ValidationIssue> onValidationError)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

System.Action<ILineItem, ValidationIssue> onValidationError

A callback that is invoked if a validation issue is detected.

AdjustInventoryOrRemoveLineItems(IOrderGroup, Action<ILineItem, ValidationIssue>, IInventoryProcessor)

Adjusts the inventory.

Declaration
public static void AdjustInventoryOrRemoveLineItems(this IOrderGroup orderGroup, Action<ILineItem, ValidationIssue> onValidationError, IInventoryProcessor inventoryProcessor)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

System.Action<ILineItem, ValidationIssue> onValidationError

A callback that is invoked if a validation issue is detected.

IInventoryProcessor inventoryProcessor

The inventory processor.

ApplyDiscounts(IOrderGroup)

Applies the discounts.

Declaration
public static IEnumerable<RewardDescription> ApplyDiscounts(this IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

An System.Collections.Generic.IEnumerable<T>

ApplyDiscounts(IOrderGroup, IPromotionEngine, PromotionEngineSettings)

Applies the discounts.

Declaration
public static IEnumerable<RewardDescription> ApplyDiscounts(this IOrderGroup orderGroup, IPromotionEngine promotionEngine, PromotionEngineSettings settings)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IPromotionEngine promotionEngine

The promotion engine.

PromotionEngineSettings settings

The settings.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

An System.Collections.Generic.IEnumerable<T>

ApplyDiscounts(IOrderGroup, PromotionEngineSettings)

Applies the discounts.

Declaration
public static IEnumerable<RewardDescription> ApplyDiscounts(this IOrderGroup orderGroup, PromotionEngineSettings settings)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

PromotionEngineSettings settings

The settings.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

An System.Collections.Generic.IEnumerable<T>

GetAllLineItems(IOrderGroup)

Gets all line items for the IOrderGroup.

Declaration
public static IEnumerable<ILineItem> GetAllLineItems(this IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

Returns
Type Description
System.Collections.Generic.IEnumerable<ILineItem>

An System.Collections.Generic.IEnumerable<T>.

GetFirstForm(IOrderGroup)

Gets the first order form from the order group. Returns null if none exists.

Declaration
public static IOrderForm GetFirstForm(this IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

Returns
Type Description
IOrderForm

The IOrderForm

GetFirstShipment(IOrderGroup)

Gets the first shipment from the first order form. Returns null if none exists.

Declaration
public static IShipment GetFirstShipment(this IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

Returns
Type Description
IShipment

The IShipment.

GetHandlingTotal(IOrderGroup)

Gets the handling total for the order.

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

The order group.

Returns
Type Description
Money

The handling total for the order group.

GetHandlingTotal(IOrderGroup, IOrderGroupCalculator)

Gets the handling total for the order.

Declaration
public static Money GetHandlingTotal(this IOrderGroup orderGroup, IOrderGroupCalculator orderGroupCalculator)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IOrderGroupCalculator orderGroupCalculator

The order group calculator.

Returns
Type Description
Money

The handling total for the order group.

GetOrderDiscountTotal(IOrderGroup, Currency)

Gets the order discount price.

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

The order group.

Currency currency

The currency.

Returns
Type Description
Money

The order discount price.

GetOrderDiscountTotal(IOrderGroup, Currency, IOrderGroupCalculator)

Gets the order discount price.

Declaration
public static Money GetOrderDiscountTotal(this IOrderGroup orderGroup, Currency currency, IOrderGroupCalculator orderGroupCalculator)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

Currency currency

The currency.

IOrderGroupCalculator orderGroupCalculator

The order group calculator.

Returns
Type Description
Money

The order discount price.

GetShippingDiscountTotal(IOrderGroup)

Gets the shipping subtotal for the order group.

Declaration
public static Money GetShippingDiscountTotal(this IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

Returns
Type Description
Money

The shipping subtotal.

GetShippingDiscountTotal(IOrderGroup, IShippingCalculator)

Gets the shipping subtotal for the order group.

Declaration
public static Money GetShippingDiscountTotal(this IOrderGroup orderGroup, IShippingCalculator shippingCalculator)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IShippingCalculator shippingCalculator

The shipping calculator.

Returns
Type Description
Money

The shipping subtotal.

GetShippingSubTotal(IOrderGroup)

Gets the shipping subtotal for the order group.

Declaration
public static Money GetShippingSubTotal(this IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

Returns
Type Description
Money

The shipping subtotal.

GetShippingSubTotal(IOrderGroup, IShippingCalculator)

Gets the shipping subtotal for the order group.

Declaration
public static Money GetShippingSubTotal(this IOrderGroup orderGroup, IShippingCalculator shippingCalculator)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IShippingCalculator shippingCalculator

The shipping calculator.

Returns
Type Description
Money

The shipping subtotal.

GetSubTotal(IOrderGroup)

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

Declaration
public static Money GetSubTotal(this 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.

GetSubTotal(IOrderGroup, IOrderGroupCalculator)

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

Declaration
public static Money GetSubTotal(this IOrderGroup orderGroup, IOrderGroupCalculator orderGroupCalculator)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IOrderGroupCalculator orderGroupCalculator

The order group calculator.

Returns
Type Description
Money

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

GetTotal(IOrderGroup)

Gets the total for the order.

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

The order group.

Returns
Type Description
Money

The total for the order group.

GetTotal(IOrderGroup, IOrderGroupCalculator)

Gets the total for the order.

Declaration
public static Money GetTotal(this IOrderGroup orderGroup, IOrderGroupCalculator orderGroupCalculator)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IOrderGroupCalculator orderGroupCalculator

The order group calculator.

Returns
Type Description
Money

The total for the order group.

ProcessPayments(IOrderGroup)

Processes the payments.

Declaration
public static void ProcessPayments(this IOrderGroup orderGroup)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

ProcessPayments(IOrderGroup, IPaymentProcessor, IOrderGroupCalculator)

Processes the payments.

Declaration
public static void ProcessPayments(this IOrderGroup orderGroup, IPaymentProcessor paymentProcessor, IOrderGroupCalculator orderGroupCalculator)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IPaymentProcessor paymentProcessor

The payment processor.

IOrderGroupCalculator orderGroupCalculator

The order group calculator.

UpdateInventoryOrRemoveLineItems(IOrderGroup, Action<ILineItem, ValidationIssue>)

Updates the inventory for the IOrderGroup or removes the line item if no available inventory.

Declaration
public static void UpdateInventoryOrRemoveLineItems(this IOrderGroup orderGroup, Action<ILineItem, ValidationIssue> onValidationError)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

System.Action<ILineItem, ValidationIssue> onValidationError

The on validation error.

UpdateInventoryOrRemoveLineItems(IOrderGroup, Action<ILineItem, ValidationIssue>, IInventoryProcessor)

Updates the inventory for the IOrderGroup or removes the line item if no available inventory.

Declaration
public static void UpdateInventoryOrRemoveLineItems(this IOrderGroup orderGroup, Action<ILineItem, ValidationIssue> onValidationError, IInventoryProcessor inventoryProcessor)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

System.Action<ILineItem, ValidationIssue> onValidationError

A callback that is invoked if a validation issue is detected.

IInventoryProcessor inventoryProcessor

The inventory processor.

UpdateLineItemQuantity(IOrderGroup, IShipment, ILineItem, Decimal)

Updates quantity of a line item in a shipment.

Declaration
public static void UpdateLineItemQuantity(this IOrderGroup orderGroup, IShipment shipment, ILineItem lineItem, decimal quantity)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

IShipment shipment

The shipment where the line item belongs to.

ILineItem lineItem

The line item that needs to change the quantity.

System.Decimal quantity

The new quantity.

UpdatePlacedPriceOrRemoveLineItems(IOrderGroup, CustomerContact, Action<ILineItem, ValidationIssue>, IPlacedPriceProcessor)

Updates all of the line item placed prices for the specified IOrderGroup or removes the line item if their is no valid price.

Declaration
public static void UpdatePlacedPriceOrRemoveLineItems(this IOrderGroup orderGroup, CustomerContact customerContact, Action<ILineItem, ValidationIssue> onValidationError, IPlacedPriceProcessor placedPriceUpdater)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

CustomerContact customerContact
System.Action<ILineItem, ValidationIssue> onValidationError

A callback that is invoked if a validation issue is detected.

IPlacedPriceProcessor placedPriceUpdater

The placed price updater.

UpdatePlacedPriceOrRemoveLineItems(IOrderGroup, Action<ILineItem, ValidationIssue>)

Updates all of the line item placed prices for the specified IOrderGroup or removes the line item if their is no valid price.

Declaration
public static void UpdatePlacedPriceOrRemoveLineItems(this IOrderGroup orderGroup, Action<ILineItem, ValidationIssue> onValidationError)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

System.Action<ILineItem, ValidationIssue> onValidationError

A callback that is invoked if a validation issue is detected.

ValidateOrRemoveLineItems(IOrderGroup, Action<ILineItem, ValidationIssue>)

Validates the line items and removes from the IOrderGroup if they are invalid.

Declaration
public static void ValidateOrRemoveLineItems(this IOrderGroup orderGroup, Action<ILineItem, ValidationIssue> onValidationError)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

System.Action<ILineItem, ValidationIssue> onValidationError

A callback that is invoked if a validation issue is detected.

ValidateOrRemoveLineItems(IOrderGroup, Action<ILineItem, ValidationIssue>, ILineItemValidator)

Validates the line items and removes from the IOrderGroup if they are invalid..

Declaration
public static void ValidateOrRemoveLineItems(this IOrderGroup orderGroup, Action<ILineItem, ValidationIssue> onValidationError, ILineItemValidator lineItemValidator)
Parameters
Type Name Description
IOrderGroup orderGroup

The order group.

System.Action<ILineItem, ValidationIssue> onValidationError

A callback that is invoked if a validation issue is detected.

ILineItemValidator lineItemValidator

The line item validator.