Table of Contents

Class ProductCondition

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

A condition that checks if a product is in the order.

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

Constructors

ProductCondition()

public ProductCondition()

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 each selected product once.

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

Property Value

bool

ExcludedProducts

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

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

Property Value

string

IncludedProducts

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

[AddInParameterGroup("Selected products")]
[AddInParameter("IncludedProducts")]
[AddInLabel("Included products")]
[AddInParameterEditor(typeof(ProductSelectorParameterEditor), "Multiple=true;OnlyMasterProducts=false;explanation=If any products is selected, it will only apply to those. If none are selected, it will apply to all products.")]
public string? IncludedProducts { 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;")]
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