Table of Contents

Class ProductGroupCondition

Namespace
Dynamicweb.Ecommerce.Orders.Adjustments.Conditions
Assembly
Dynamicweb.Ecommerce.dll

A condition that checks if a certain amount of products from a certain product group is in the order.

[Experimental("DWEX100001")]
[AddInLabel("Product group")]
[AddInUseParameterSectioning(true)]
public sealed class ProductGroupCondition : Condition, IParameterOptions
Inheritance
ProductGroupCondition
Implements
Inherited Members

Constructors

ProductGroupCondition()

public ProductGroupCondition()

Properties

ContextType

The type of context the condition is applied to.

public override AdjustmentContextType ContextType { get; }

Property Value

AdjustmentContextType

DistinctQuantity

If true, the condition will only count unique products from the selected product groups.

[AddInParameterGroup("Condition")]
[AddInParameter("DistinctQuantity")]
[AddInLabel("Distinct quantity")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
public bool DistinctQuantity { get; set; }

Property Value

bool

ExcludedProductGroups

The product groups which products cannot exist in the order, separated by ',' to check against the ProductAdjustmentContexts product key or OrderAdjustmentContexts orderlines.

[AddInParameterGroup("Selected products")]
[AddInParameter("ExcludedProductGroups")]
[AddInLabel("Excluded products groups")]
[AddInParameterEditor(typeof(ProductGroupParameterEditor), "Multiple=true;OnlyMasterProducts=false;explanation=If any product group is selected, it will exclude those product groups and apply to all products not in those groups. If none are selected, it will apply to all products as no product groups are excluded.")]
public string? ExcludedProductGroups { get; set; }

Property Value

string

IncludedProductGroups

The product groups which products has to exist in the order, separated by ',' to check against the ProductAdjustmentContexts product key or OrderAdjustmentContexts orderlines.

[AddInParameterGroup("Selected products")]
[AddInParameter("IncludedProductGroups")]
[AddInLabel("Included product groups")]
[AddInParameterEditor(typeof(ProductGroupParameterEditor), "Multiple=true;OnlyMasterProducts=false;explanation=If any product group is selected, it will only apply to products in those groups. If none are selected, it will apply to all products.")]
public string? IncludedProductGroups { get; set; }

Property Value

string

Quantity

The minimum quantity in order of any selected products. If the quantity is 1, it will also be applied to the product list and details page.

[AddInParameterGroup("Condition")]
[AddInParameter("Quantity")]
[AddInLabel("Quantity")]
[AddInParameterEditor(typeof(NumberParameterEditor), "required=true;minValue=1d;explanation=Min. total quantity in cart of any selected products")]
public double Quantity { get; set; }

Property Value

double

Methods

GetDisplayValue(string)

Returns the UI display format for the condition, visible in the overview screens where conditions are used.

public override string? GetDisplayValue(string parameterName)

Parameters

parameterName string

The name of the parameter.

Returns

string

GetParameterOptions(string)

public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)

Parameters

parameterName string

Returns

IEnumerable<ParameterOption>

IsSatisfied(AdjustmentContext)

Returns whether the condition is satisfied.

public override bool IsSatisfied(AdjustmentContext context)

Parameters

context AdjustmentContext

The current context, either a OrderAdjustmentContext or ProductAdjustmentContext.

Returns

bool
To top