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
Actual
Gets a value indicating whether this order time lays within "valid from - valid to" interval.
public bool Actual { get; }
Property Value
AddFreeShipping
public bool AddFreeShipping { get; set; }
Property Value
Amount
Gets or sets the fixed discount amount of the instance.
public double Amount { get; set; }
Property Value
AmountIncludesVat
public bool AmountIncludesVat { get; set; }
Property Value
AmountProductFieldName
Gets or sets the name of amount product field of the discount.
public string AmountProductFieldName { get; set; }
Property Value
AnonymousUsers
public bool AnonymousUsers { get; set; }
Property Value
AssignableFromProducts
Gets or sets the value indicating whether instance is assignable from products and groups.
public bool AssignableFromProducts { get; set; }
Property Value
CampaignColor
public string CampaignColor { get; set; }
Property Value
CampaignImage
public string CampaignImage { get; set; }
Property Value
CampaignName
Gets or sets the default campaign name
public string CampaignName { get; set; }
Property Value
CheckForValidationReason
Gets the value which indicates that validation reason should be checked
public bool CheckForValidationReason { get; set; }
Property Value
Country
Gets or sets the country of the discount.
public Country Country { get; set; }
Property Value
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
CreatedBy
public int CreatedBy { get; set; }
Property Value
CreatedDate
public DateTime? CreatedDate { get; set; }
Property Value
Currency
Gets or sets the currency of the discount.
public Currency Currency { get; set; }
Property Value
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
Description
Gets or sets the default description of the instance.
public string Description { get; set; }
Property Value
DiscountApplyToProduct
Gets or sets the DiscountApplyToProduct of the instance.
public DiscountApplyToProduct DiscountApplyToProduct { get; set; }
Property Value
DiscountApplyType
Gets or sets the DiscountApplyType of the instance.
public DiscountApplyType DiscountApplyType { get; set; }
Property Value
DiscountType
Gets or sets the DiscountType of the instance.
public DiscountTypes DiscountType { get; set; }
Property Value
ExcludedProductsAndGroupsIds
public string ExcludedProductsAndGroupsIds { get; set; }
Property Value
Extender
Gets a reference To the extender instance
public DiscountExtenderBase Extender { get; }
Property Value
ExtenderSettings
Gets or sets the extender parameters.
public string ExtenderSettings { get; set; }
Property Value
ExtenderType
Gets Or sets the name of the extender type.
public string ExtenderType { get; set; }
Property Value
ExternalId
Gets or sets the external id
public string ExternalId { get; set; }
Property Value
HasProductRestrictions
public bool HasProductRestrictions { get; }
Property Value
ID
public int ID { get; set; }
Property Value
IsApplyDiscountOnce
public bool IsApplyDiscountOnce { get; set; }
Property Value
IsNew
public bool IsNew { get; }
Property Value
Language
Gets or sets the language of the discount.
public Language Language { get; set; }
Property Value
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
LoyaltyPointsRate
public double LoyaltyPointsRate { get; set; }
Property Value
MaximumLimits
public List<DiscountLimit> MaximumLimits { get; set; }
Property Value
Name
Gets or sets the default name of the instance.
public string Name { get; set; }
Property Value
OnlyApplyToNonDiscountedItems
public bool OnlyApplyToNonDiscountedItems { get; set; }
Property Value
OrderContextId
Gets or sets the order context id of the discount.
public string OrderContextId { get; set; }
Property Value
OrderFieldName
Gets or sets the name of order field of the discount.
public string OrderFieldName { get; set; }
Property Value
OrderFieldValue
Gets or sets the required value of the order field specified in the OrderFieldName property.
public string OrderFieldValue { get; set; }
Property Value
OrderTotalPrice
Gets or sets the order total price condition. Default value is 0.00
public double OrderTotalPrice { get; set; }
Property Value
OrderTotalPriceCondition
Gets or sets the conditional operator for comparing the order total price.
public OrderTotalPriceCondition OrderTotalPriceCondition { get; set; }
Property Value
OrderTotalPriceCurrencyCode
Gets or sets the order total price condition currency
public string OrderTotalPriceCurrencyCode { get; set; }
Property Value
Payment
Gets or sets the payment of the discount.
public Payment Payment { get; set; }
Property Value
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
Percentage
Gets or sets the discount percentage of the instance.
public double Percentage { get; set; }
Property Value
Priority
public int Priority { get; set; }
Property Value
ProductAsDiscount
Gets or sets the product and/or product variant that acts as a discount.
public Product ProductAsDiscount { get; set; }
Property Value
ProductIdByDiscount
Gets or sets the ID of the product that acts as a discount.
public string ProductIdByDiscount { get; set; }
Property Value
ProductQuantification
Gets or sets the product quantification the discount uses when validating product quantities.
public ProductQuantification ProductQuantification { get; set; }
Property Value
ProductQuantity
Gets or sets the product quantity required for the discount to be valid.
public double ProductQuantity { get; set; }
Property Value
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
ProductsAndGroupsIds
public string ProductsAndGroupsIds { get; set; }
Property Value
Shipping
Gets or sets the shipping of the discount.
public Shipping Shipping { get; set; }
Property Value
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
Shop
Gets or sets the shop of the discount.
public Shop Shop { get; set; }
Property Value
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
StopFurtherProcessing
public bool StopFurtherProcessing { get; set; }
Property Value
Translations
Gets the translations.
public TranslationCollection<DiscountTranslation> Translations { get; }
Property Value
UpdatedBy
public int UpdatedBy { get; set; }
Property Value
UpdatedDate
public DateTime? UpdatedDate { get; set; }
Property Value
UsePerCustomer
public int UsePerCustomer { get; set; }
Property Value
User
Gets or sets the user of the discount.
public User User { get; set; }
Property Value
UserCustomerNumber
Gets or sets the customer number the discount is valid for Null is all customer numbers.
public string UserCustomerNumber { get; set; }
Property Value
UserGroup
Gets or sets the user group of the discount.
public UserGroup UserGroup { get; set; }
Property Value
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
ValidTo
Gets or sets the data and time to which the instance is valid.
public DateTime? ValidTo { get; set; }
Property Value
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
GetDescription(string)
Gets the translated description in specified language
public string GetDescription(string languageId)
Parameters
languageId
string
Returns
GetName(string)
Gets the translated name in specified language
public string GetName(string languageId)
Parameters
languageId
string
Returns
GetVoucherList()
Gets the voucher list of the discount.
public VoucherList GetVoucherList()
Returns
SetCampaignName(string, string)
Sets the translated campaign name in specified language
public void SetCampaignName(string languageId, string campaignName)
Parameters
SetDescription(string, string)
Sets the translated description in specified language
public void SetDescription(string languageId, string description)
Parameters
SetName(string, string)
Sets the translated name in specified language
public void SetName(string languageId, string name)
Parameters
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.