Table of Contents

Class Discount

Namespace
Dynamicweb.Ecommerce.Orders.Discounts
Assembly
Dynamicweb.Ecommerce.dll

Represents information about a discount.

public class Discount
Inheritance
Discount
Inherited Members

Constructors

Discount()

Initializes a new instance of the Discount class.

public Discount()

Properties

Active

Gets or sets the value indicating whether instance is active.

public bool Active { get; set; }

Property Value

bool

Actual

Gets a value indicating whether this order time lays within "valid from - valid to" interval.

public bool Actual { get; }

Property Value

bool

AddFreeShipping

public bool AddFreeShipping { get; set; }

Property Value

bool

Amount

Gets or sets the fixed discount amount of the instance.

public double Amount { get; set; }

Property Value

double

AmountIncludesVat

public bool AmountIncludesVat { get; set; }

Property Value

bool

AmountProductFieldName

Gets or sets the name of amount product field of the discount.

public string AmountProductFieldName { get; set; }

Property Value

string

AnonymousUsers

public bool AnonymousUsers { get; set; }

Property Value

bool

AssignableFromProducts

Gets or sets the value indicating whether instance is assignable from products and groups.

public bool AssignableFromProducts { get; set; }

Property Value

bool

CampaignColor

public string CampaignColor { get; set; }

Property Value

string

CampaignImage

public string CampaignImage { get; set; }

Property Value

string

CampaignName

Gets or sets the default campaign name

public string CampaignName { get; set; }

Property Value

string

CheckForValidationReason

Gets the value which indicates that validation reason should be checked

public bool CheckForValidationReason { get; set; }

Property Value

bool

Country

Gets or sets the country of the discount.

public Country Country { get; set; }

Property Value

Country

CountryCode2

Gets or sets the country code of the country the discount is valid for Null is all countries.

public string CountryCode2 { get; set; }

Property Value

string

CreatedBy

public int CreatedBy { get; set; }

Property Value

int

CreatedDate

public DateTime? CreatedDate { get; set; }

Property Value

DateTime?

Currency

Gets or sets the currency of the discount.

public Currency Currency { get; set; }

Property Value

Currency

Exceptions

Exception

Thrown when DiscountType property is DiscountTypes.Percentage and the value is not set to null.

CurrencyCode

Gets or sets the currency code of the currency the fixed discount amount / loyalty point rate.

public string CurrencyCode { get; set; }

Property Value

string

Description

Gets or sets the default description of the instance.

public string Description { get; set; }

Property Value

string

DiscountApplyToProduct

Gets or sets the DiscountApplyToProduct of the instance.

public DiscountApplyToProduct DiscountApplyToProduct { get; set; }

Property Value

DiscountApplyToProduct

DiscountApplyType

Gets or sets the DiscountApplyType of the instance.

public DiscountApplyType DiscountApplyType { get; set; }

Property Value

DiscountApplyType

DiscountType

Gets or sets the DiscountType of the instance.

public DiscountTypes DiscountType { get; set; }

Property Value

DiscountTypes

ExcludedProductsAndGroupsIds

public string ExcludedProductsAndGroupsIds { get; set; }

Property Value

string

Extender

Gets a reference To the extender instance

public DiscountExtenderBase Extender { get; }

Property Value

DiscountExtenderBase

ExtenderSettings

Gets or sets the extender parameters.

public string ExtenderSettings { get; set; }

Property Value

string

ExtenderType

Gets Or sets the name of the extender type.

public string ExtenderType { get; set; }

Property Value

string

ExternalId

Gets or sets the external id

public string ExternalId { get; set; }

Property Value

string

HasProductRestrictions

public bool HasProductRestrictions { get; }

Property Value

bool

ID

public int ID { get; set; }

Property Value

int

IsApplyDiscountOnce

public bool IsApplyDiscountOnce { get; set; }

Property Value

bool

IsNew

public bool IsNew { get; }

Property Value

bool

Language

Gets or sets the language of the discount.

public Language Language { get; set; }

Property Value

Language

LanguageId

Gets or sets the ID of the language the discount is valid for Null is all languages.

public string LanguageId { get; set; }

Property Value

string

LoyaltyPointsRate

public double LoyaltyPointsRate { get; set; }

Property Value

double

MaximumLimits

public List<DiscountLimit> MaximumLimits { get; set; }

Property Value

List<DiscountLimit>

Name

Gets or sets the default name of the instance.

public string Name { get; set; }

Property Value

string

OnlyApplyToNonDiscountedItems

public bool OnlyApplyToNonDiscountedItems { get; set; }

Property Value

bool

OrderContextId

Gets or sets the order context id of the discount.

public string OrderContextId { get; set; }

Property Value

string

OrderFieldName

Gets or sets the name of order field of the discount.

public string OrderFieldName { get; set; }

Property Value

string

OrderFieldValue

Gets or sets the required value of the order field specified in the OrderFieldName property.

public string OrderFieldValue { get; set; }

Property Value

string

OrderTotalPrice

Gets or sets the order total price condition. Default value is 0.00

public double OrderTotalPrice { get; set; }

Property Value

double

OrderTotalPriceCondition

Gets or sets the conditional operator for comparing the order total price.

public OrderTotalPriceCondition OrderTotalPriceCondition { get; set; }

Property Value

OrderTotalPriceCondition

OrderTotalPriceCurrencyCode

Gets or sets the order total price condition currency

public string OrderTotalPriceCurrencyCode { get; set; }

Property Value

string

Payment

Gets or sets the payment of the discount.

public Payment Payment { get; set; }

Property Value

Payment

PaymentId

Gets or sets the Id of the payment the discount is valid for Null is all payments.

public string PaymentId { get; set; }

Property Value

string

Percentage

Gets or sets the discount percentage of the instance.

public double Percentage { get; set; }

Property Value

double

Priority

public int Priority { get; set; }

Property Value

int

ProductAsDiscount

Gets or sets the product and/or product variant that acts as a discount.

public Product ProductAsDiscount { get; set; }

Property Value

Product

ProductIdByDiscount

Gets or sets the ID of the product that acts as a discount.

public string ProductIdByDiscount { get; set; }

Property Value

string

ProductQuantification

Gets or sets the product quantification the discount uses when validating product quantities.

public ProductQuantification ProductQuantification { get; set; }

Property Value

ProductQuantification

ProductQuantity

Gets or sets the product quantity required for the discount to be valid.

public double ProductQuantity { get; set; }

Property Value

double

ProductVariantIdByDiscount

Gets or sets the ID of the product variant of the product that acts as a discount.

public string ProductVariantIdByDiscount { get; set; }

Property Value

string

ProductsAndGroupsIds

public string ProductsAndGroupsIds { get; set; }

Property Value

string

Shipping

Gets or sets the shipping of the discount.

public Shipping Shipping { get; set; }

Property Value

Shipping

ShippingAmount

Gets or sets the amount if the discount is a shipping discount.

public double ShippingAmount { get; set; }

Property Value

double

The shipping amount.

ShippingCurrency

Gets or sets the currency code of the shpping amount if the discount is a shipping discount.

public string ShippingCurrency { get; set; }

Property Value

string

The shipping currency.

ShippingId

Gets or set the ID of the shipping the discount is valid for Null is all shipping.

public string ShippingId { get; set; }

Property Value

string

Shop

Gets or sets the shop of the discount.

public Shop Shop { get; set; }

Property Value

Shop

ShopId

Gets or sets the ID of the shop the discount is valid for Null is all shops.

public string ShopId { get; set; }

Property Value

string

StopFurtherProcessing

public bool StopFurtherProcessing { get; set; }

Property Value

bool

Translations

Gets the translations.

public TranslationCollection<DiscountTranslation> Translations { get; }

Property Value

TranslationCollection<DiscountTranslation>

UpdatedBy

public int UpdatedBy { get; set; }

Property Value

int

UpdatedDate

public DateTime? UpdatedDate { get; set; }

Property Value

DateTime?

UsePerCustomer

public int UsePerCustomer { get; set; }

Property Value

int

User

Gets or sets the user of the discount.

public User User { get; set; }

Property Value

User

UserCustomerNumber

Gets or sets the customer number the discount is valid for Null is all customer numbers.

public string UserCustomerNumber { get; set; }

Property Value

string

UserGroup

Gets or sets the user group of the discount.

public UserGroup UserGroup { get; set; }

Property Value

UserGroup

UserGroupId

Gets or sets the Id of the user group the discount is valid for Null is all user groups.

public int? UserGroupId { get; set; }

Property Value

int?

UserId

Gets or sets the ID of the user the discount is valid for Null is all users.

public int? UserId { get; set; }

Property Value

int?

ValidFrom

Gets or sets the date and time from when the instance is valid.

public DateTime? ValidFrom { get; set; }

Property Value

DateTime?

ValidTo

Gets or sets the data and time to which the instance is valid.

public DateTime? ValidTo { get; set; }

Property Value

DateTime?

VoucherListId

Gets or sets the ID of the voucher list to use when OrderFieldName is “OrderVoucherCode”.

public int? VoucherListId { get; set; }

Property Value

int?

Exceptions

Exception

Trown when OrderFieldName property is not set to “OrderVoucherCode” and value is not set to null.

Methods

GetCampaignName(string)

Gets the translated campaign name in specified language

public string GetCampaignName(string languageId)

Parameters

languageId string

Returns

string

GetDescription(string)

Gets the translated description in specified language

public string GetDescription(string languageId)

Parameters

languageId string

Returns

string

GetName(string)

Gets the translated name in specified language

public string GetName(string languageId)

Parameters

languageId string

Returns

string

GetVoucherList()

Gets the voucher list of the discount.

public VoucherList GetVoucherList()

Returns

VoucherList

SetCampaignName(string, string)

Sets the translated campaign name in specified language

public void SetCampaignName(string languageId, string campaignName)

Parameters

languageId string
campaignName string

SetDescription(string, string)

Sets the translated description in specified language

public void SetDescription(string languageId, string description)

Parameters

languageId string
description string

SetName(string, string)

Sets the translated name in specified language

public void SetName(string languageId, string name)

Parameters

languageId string
name string

SetVoucherList(VoucherList)

Set the voucher list of the discount.

public void SetVoucherList(VoucherList voucherList)

Parameters

voucherList VoucherList

Exceptions

Exception

Thrown when the OrderFieldName property is not set to “OrderVoucherCode” and the value of this property is not set to null.

To top