Table of Contents

Class PriceCalculated

Namespace
Dynamicweb.Ecommerce.Prices
Assembly
Dynamicweb.Ecommerce.dll
Represents information about calculated price.
[Serializable]
public class PriceCalculated : PriceInfo, IPriceReferenceInfo, IInformativePriceInfo, IPriceInfo, IPriceSourceInfo
Inheritance
PriceCalculated
Implements
Inherited Members

Constructors

PriceCalculated()

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated()

PriceCalculated(Currency, Country)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country)

Parameters

currency Currency
country Country

PriceCalculated(Currency, Country, PriceRaw)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, PriceRaw priceRaw)

Parameters

currency Currency
country Country
priceRaw PriceRaw

PriceCalculated(Currency, Country, PriceRaw, bool)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, PriceRaw priceRaw, bool isInformative)

Parameters

currency Currency
country Country
priceRaw PriceRaw
isInformative bool

PriceCalculated(Currency, Country, Product)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, Product product)

Parameters

currency Currency
country Country
product Product

PriceCalculated(Currency, Country, Product, PriceRaw)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, Product product, PriceRaw priceRaw)

Parameters

currency Currency
country Country
product Product
priceRaw PriceRaw

PriceCalculated(Currency, Country, Product, PriceRaw, bool)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, Product product, PriceRaw priceRaw, bool isInformative)

Parameters

currency Currency
country Country
product Product
priceRaw PriceRaw
isInformative bool

PriceCalculated(Currency, Country, Product, bool)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, Product product, bool isInformative)

Parameters

currency Currency
country Country
product Product
isInformative bool

PriceCalculated(Currency, Country, Product, bool, User)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, Product product, bool isInformative, User user)

Parameters

currency Currency
country Country
product Product
isInformative bool
user User

PriceCalculated(Currency, Country, Product, bool, string, User)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, Product product, bool isInformative, string unitId, User user)

Parameters

currency Currency
country Country
product Product
isInformative bool
unitId string
user User

PriceCalculated(Currency, Country, Product, bool, string, User, string)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, Product product, bool isInformative, string unitId, User user, string shopId)

Parameters

currency Currency
country Country
product Product
isInformative bool
unitId string
user User
shopId string

PriceCalculated(Currency, Country, Product, bool, string, User, string, StockLocation)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, Product product, bool isInformative, string unitId, User user, string shopId, StockLocation stockLocation)

Parameters

currency Currency
country Country
product Product
isInformative bool
unitId string
user User
shopId string
stockLocation StockLocation

PriceCalculated(Currency, Country, bool)

[Obsolete("Use Create method, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Currency currency, Country country, bool isInformative)

Parameters

currency Currency
country Country
isInformative bool

PriceCalculated(PriceRaw)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(PriceRaw priceRaw)

Parameters

priceRaw PriceRaw

PriceCalculated(PriceRaw, bool)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(PriceRaw priceRaw, bool isInformative)

Parameters

priceRaw PriceRaw
isInformative bool

PriceCalculated(Product)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Product product)

Parameters

product Product

PriceCalculated(Product, PriceRaw)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Product product, PriceRaw priceRaw)

Parameters

product Product
priceRaw PriceRaw

PriceCalculated(Product, PriceRaw, bool)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Product product, PriceRaw priceRaw, bool isInformative)

Parameters

product Product
priceRaw PriceRaw
isInformative bool

PriceCalculated(Product, bool)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(Product product, bool isInformative)

Parameters

product Product
isInformative bool

PriceCalculated(bool)

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceCalculated(bool isInformative)

Parameters

isInformative bool

Properties

IgnoreRounding

Gets or sets a value indicating whether to bypass calculations of a given Rounding.
public bool IgnoreRounding { get; set; }

Property Value

bool
true if calculation should be bypassed; otherwise, false.

IgnoreVat

Gets or sets a value indicating whether to bypass VAT calculations.
public bool IgnoreVat { get; set; }

Property Value

bool
true if VAT calculations should be bypassed; otherwise, false.

PriceRaw

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public PriceRaw PriceRaw { get; set; }

Property Value

PriceRaw

Product

[Obsolete("Use one of the static Create methods, set relevant properties and then call the Calculate method.")]
public Product Product { get; set; }

Property Value

Product

RemoveVat

Gets or sets a value indicating whether to remove VAT from the current price.
public bool RemoveVat { get; set; }

Property Value

bool
true if price calculation should remove VAT from the current price; otherwise, false.

Remarks

The VAT is only removed if prices in the database include VAT. Otherwise, price calculation does not change with the value of this property.

VATPercent

Gets or sets the VAT percent.
public override double VATPercent { get; set; }

Property Value

double

Methods

Calculate()

public void Calculate()

Create(Currency, Country, PriceRaw)

Creates a new instance of the PriceCalculated class.
public static PriceCalculated Create(Currency currency, Country country, PriceRaw priceRaw)

Parameters

currency Currency
country Country
priceRaw PriceRaw

Returns

PriceCalculated

Create(PriceContext, PriceRaw)

Creates a new instance of the PriceCalculated class.
public static PriceCalculated Create(PriceContext context, PriceRaw priceRaw)

Parameters

context PriceContext
priceRaw PriceRaw

Returns

PriceCalculated

Create(PriceContext, PriceRaw, Product)

Creates a new instance of the PriceCalculated class.
public static PriceCalculated Create(PriceContext context, PriceRaw priceRaw, Product product)

Parameters

context PriceContext
priceRaw PriceRaw
product Product

Returns

PriceCalculated

FindVatPercent(Country)

Finds the VAT percent for the given Country.
public static double FindVatPercent(Country country)

Parameters

country Country
The country used to determine VAT percent.

Returns

double

FindVatPercent(Country, Product, bool)

Finds the VAT percent for the given Country and Product.
public static double FindVatPercent(Country country, Product product, bool reverseChargeForVatEnabled)

Parameters

country Country
The country used to determine VAT percent.
product Product
The product to get the VAT percent for.
reverseChargeForVatEnabled bool

Returns

double

GetCountryVAT()

[Obsolete("Use the static method FindVatPercent instead.")]
public double GetCountryVAT()

Returns

double

ToString()

Returns a string that represents this instance.
public override string ToString()

Returns

string
A string that represents this instance.
To top