Table of Contents

Class VoucherCondition

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

A condition that checks if a voucher is applied to an order.

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

Properties

ContextType

The type of context the condition is applied to.

public override AdjustmentContextType ContextType { get; }

Property Value

AdjustmentContextType

VoucherCode

The voucher code to check against the OrderAdjustmentContexts voucher code.

[AddInParameterGroup("Condition")]
[AddInParameter("VoucherCode")]
[AddInLabel("Voucher code")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
public string? VoucherCode { get; set; }

Property Value

string

VoucherListId

The voucher list to check against the OrderAdjustmentContexts voucher code.

[AddInParameterGroup("Condition")]
[AddInParameter("VoucherList")]
[AddInLabel("Voucher list")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "")]
public int VoucherListId { get; set; }

Property Value

int

VoucherType

Determines if the condition should check against a voucher list or a voucher code.

[AddInParameterGroup("Condition")]
[AddInParameter("VoucherType")]
[AddInLabel("Voucher type")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false;required=true")]
public VoucherType VoucherType { get; set; }

Property Value

VoucherType

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

GetHiddenParameterNames(string, object?)

public IEnumerable<string> GetHiddenParameterNames(string parameterName, object? parameterValue)

Parameters

parameterName string
parameterValue object

Returns

IEnumerable<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