Table of Contents

Class SalesDiscount

Namespace
Dynamicweb.Ecommerce.Orders.SalesDiscounts
Assembly
Dynamicweb.Ecommerce.dll
The class SalesDiscount represents old discount model(Discount).
[Obsolete("Sales discount functionality is obsolete. Use Dynamicweb.Ecommerce.Orders.Discounts.* instead.")]
[Serializable]
public class SalesDiscount : ICloneable
Inheritance
SalesDiscount
Implements
Inherited Members

Properties

Active

Gets or sets a value indicating whether this SalesDiscount is active.
public bool Active { get; set; }

Property Value

bool
true if active; otherwise, false.

Actual

Gets a value indicating whether this SalesDiscount is actual.
public bool Actual { get; }

Property Value

bool
true if actual; otherwise, false.

Converted

Gets or sets a value indicating whether this SalesDiscount is converted.
[Obsolete("This property is no longer used.")]
public bool Converted { get; set; }

Property Value

bool
true if converted; otherwise, false.

Countries

Gets or sets the countries.
public List<string> Countries { get; set; }

Property Value

List<string>
The countries.

CustomersAndGroups

Gets or sets the customers and groups.
public string CustomersAndGroups { get; set; }

Property Value

string
The customers and groups.

DateFrom

Gets or sets the date from.
public DateTime DateFrom { get; set; }

Property Value

DateTime
The date from.

DateTo

Gets or sets the date to.
public DateTime DateTo { get; set; }

Property Value

DateTime
The date to.

Description

Gets or sets the description.
public string Description { get; set; }

Property Value

string
The description.

DiscountType

Gets or sets the type of the discount.
public string DiscountType { get; set; }

Property Value

string
The type of the discount.

Id

Gets or sets the identifier.
public string Id { get; set; }

Property Value

string
The identifier.

IsLocalized

Returns a boolean value telling if the name and description is localized to the current language. If not the name and description is from the default language
public bool IsLocalized { get; }

Property Value

bool
true if this instance is localized; otherwise, false.

IsValid

Check If discount is valid and can be applied
public bool IsValid { get; }

Property Value

bool
true if this instance is valid; otherwise, false.

IsValidToShow

Check If discount is valid and can be shown
public bool IsValidToShow { get; }

Property Value

bool
true if this instance is valid to show; otherwise, false.

Language

Gets or sets the language.
public Language Language { get; set; }

Property Value

Language
The language.

MinimumBasketSize

Gets or sets the minimum size of the basket.
public double MinimumBasketSize { get; set; }

Property Value

double
The minimum size of the basket.

Name

Gets or sets the name.
public string Name { get; set; }

Property Value

string
The name.

Parameters

Gets or sets the parameters.
public string Parameters { get; set; }

Property Value

string
The parameters.

Shop

Gets or sets the shop.
public string Shop { get; set; }

Property Value

string
The shop.

ValueFixed

Gets or sets the value fixed.
public double ValueFixed { get; set; }

Property Value

double
The value fixed.

ValueFixedByCurrencies

Gets or sets the value fixed by currencies.
public Dictionary<string, double> ValueFixedByCurrencies { get; set; }

Property Value

Dictionary<string, double>
The value fixed by currencies.

ValueFixedForCurrency

Gets the value fixed for currency.
public double ValueFixedForCurrency { get; }

Property Value

double
The value fixed for currency.

ValuePercentage

Gets or sets the value percentage.
public double ValuePercentage { get; set; }

Property Value

double
The value percentage.

ValueProducts

Gets or sets the value products.
public ProductsHandler ValueProducts { get; set; }

Property Value

ProductsHandler
The value products.

ValueType

Gets or sets the type of the value.
public DiscountValueTypes ValueType { get; set; }

Property Value

DiscountValueTypes
The type of the value.

Methods

Clone()

Creates a new instance of a class with the same value as an existing instance.
public object Clone()

Returns

object

Remarks

Method performs a deep copy of all properties.

Delete()

Deletes this instance.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.Delete instead.")]
public void Delete()

Delete(string)

Deletes the specified identifier string.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.Delete instead.")]
public void Delete(string discountId)

Parameters

discountId string
The identifier string.

DeleteLanguageSpecificdiscount()

Deletes the language specific discount.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.DeleteTranslation instead.")]
public void DeleteLanguageSpecificdiscount()

GetSalesDiscountProvider()

Gets the sales discount provider.
public SalesDiscountProvider GetSalesDiscountProvider()

Returns

SalesDiscountProvider
SalesDiscountProvider.

GetSalesDiscounts(Language)

Gets the sales discounts.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.GetDiscounts instead.")]
public static SalesDiscountCollection GetSalesDiscounts(Language language)

Parameters

language Language
The language.

Returns

SalesDiscountCollection
SalesDiscountCollection.

GetSalesDiscounts(ProductCollection, Language)

Gets the sales discounts.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.GetDiscounts instead.")]
public static SalesDiscountCollection GetSalesDiscounts(ProductCollection products, Language language)

Parameters

products ProductCollection
The products.
language Language
The language.

Returns

SalesDiscountCollection
SalesDiscountCollection.

GetSalesDiscounts(string, Language)

Gets the sales discounts.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.GetDiscount instead.")]
public static SalesDiscountCollection GetSalesDiscounts(string discountId, Language language)

Parameters

discountId string
The sales discount identifier.
language Language
The language.

Returns

SalesDiscountCollection
SalesDiscountCollection.

IsUserValid(string)

Determines whether [is user valid] [the specified customer and groups].
[Obsolete("Use Ecommerce.Services.SalesDiscounts.IsUserValid instead.")]
public static bool IsUserValid(string customerAndGroups)

Parameters

customerAndGroups string
The customer and groups.

Returns

bool
true if [is user valid] [the specified customer and groups]; otherwise, false.

ProcessOrder(Order)

Processes the order.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.ProcessOrderDiscount instead.")]
public void ProcessOrder(Order order)

Parameters

order Order
The order.

Save()

Saves this instance.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.Save instead.")]
public void Save()

Save(string)

Saves the specified identifier string.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.Save instead.")]
public void Save(string discountId)

Parameters

discountId string
The identifier string.

SaveLanguageSpecificDiscount()

Saves the language specific discount.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.SaveTranslation instead.")]
public void SaveLanguageSpecificDiscount()

SaveLanguageSpecificDiscount(string)

Saves the language specific discount.
[Obsolete("Use Ecommerce.Services.SalesDiscounts.SaveTranslation instead.")]
public void SaveLanguageSpecificDiscount(string discountId)

Parameters

discountId string
The identifier string.

SetLocalizedName(Language, string, string)

Set translation for specified language
public void SetLocalizedName(Language language, string name, string description)

Parameters

language Language
name string
description string
To top