Class DefaultPriceProvider
- Namespace
- Dynamicweb.Ecommerce.Prices
- Assembly
- Dynamicweb.Ecommerce.dll
Represents a default price provider.
public class DefaultPriceProvider : PriceProvider
- Inheritance
-
DefaultPriceProvider
- Inherited Members
Methods
FindInformativePrice(PriceContext, PriceProductSelection)
Finds the informative price. Must be overriden.
public override PriceRaw FindInformativePrice(PriceContext context, PriceProductSelection selection)
Parameters
context
PriceContext- Context information.
selection
PriceProductSelection- Product information.
Returns
FindInformativePrice(Product, double, string, Currency, string, User)
Finds the informative price.
[Obsolete("Use overload with PriceContext")]
public override PriceRaw FindInformativePrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user)
Parameters
product
Product- The product.
quantity
double- The quantity.
variantId
string- The variant ID.
currency
Currency- The currency.
unitId
string- The unit ID.
user
User- The user.
Returns
FindInformativePrice(Product, double, string, Currency, string, User, string)
Finds the informative price.
[Obsolete("Use overload with PriceContext")]
public override PriceRaw FindInformativePrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user, string shopId)
Parameters
product
Product- The product.
quantity
double- The quantity.
variantId
string- The variant ID.
currency
Currency- The currency.
unitId
string- The unit ID.
user
User- The user.
shopId
string
Returns
FindInformativePrice(Product, double, string, Currency, string, User, string, StockLocation)
Finds the informative price.
[Obsolete("Use overload with PriceContext")]
public override PriceRaw FindInformativePrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user, string shopId, StockLocation stockLocation)
Parameters
product
Product- The product.
quantity
double- The quantity.
variantId
string- The variant ID.
currency
Currency- The currency.
unitId
string- The unit ID.
user
User- The user.
shopId
stringstockLocation
StockLocation
Returns
FindPrice(PriceContext, PriceProductSelection)
Finds the price for a given product in a given context. Can be called to show the price of a product, show the price of a product for a specific user, unit etc. Must be overriden.
public override PriceRaw FindPrice(PriceContext context, PriceProductSelection selection)
Parameters
context
PriceContext- Context information.
selection
PriceProductSelection- Product information.
Returns
Remarks
This method is called in 2 contexts. For showing a product and a product added to a cart or order. If the call comes from an order object, it can have a quantity of 2 or more and can be used to return the unit price for a product
that is cheaper if more than one is bought
FindPrice(Product, double, string, Currency, string, User)
Finds the price.
[Obsolete("Use overload with PriceContext")]
public override PriceRaw FindPrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user)
Parameters
product
Product- The product.
quantity
double- The quantity.
variantId
string- The variant id.
currency
Currency- The currency.
unitId
string- The unit id.
user
User- The user.
Returns
FindPrice(Product, double, string, Currency, string, User, double)
Finds the price.
[Obsolete("Use overload with PriceContext")]
public override PriceRaw FindPrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user, double quantityAllVariants)
Parameters
product
Product- The product.
quantity
double- The quantity.
variantId
string- The variant id.
currency
Currency- The currency.
unitId
string- The unit id.
user
User- The user.
quantityAllVariants
double- The quantity of all variants.
Returns
FindPrice(Product, double, string, Currency, string, User, double, string)
Finds the price.
[Obsolete("Use overload with PriceContext")]
public override PriceRaw FindPrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user, double quantityAllVariants, string shopId)
Parameters
product
Product- The product.
quantity
double- The quantity.
variantId
string- The variant id.
currency
Currency- The currency.
unitId
string- The unit id.
user
User- The user.
quantityAllVariants
double- The quantity of all variants.
shopId
string- The shopId.
Returns
FindPrice(Product, double, string, Currency, string, User, double, string, StockLocation)
Finds the price.
[Obsolete("Use overload with PriceContext")]
public override PriceRaw FindPrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user, double quantityAllVariants, string shopId, StockLocation stockLocation)
Parameters
product
Product- The product.
quantity
double- The quantity.
variantId
string- The variant id.
currency
Currency- The currency.
unitId
string- The unit id.
user
User- The user.
quantityAllVariants
double- The quantity of all variants.
shopId
string- The shopId.
stockLocation
StockLocation- The current stock location.
Returns
PreparePrices(PriceContext, IEnumerable<PriceProductSelection>)
Prepares prices for the given products. The loaded prices are standard Dynamicweb prices, and they are loaded using the internal API.
public override void PreparePrices(PriceContext context, IEnumerable<PriceProductSelection> selections)
Parameters
context
PriceContext- The price context
selections
IEnumerable<PriceProductSelection>- The product selections.
ShowPrice(Price, PriceContext, Product, bool)
Check if a price should be shown in a list of prices in a given context. Same as Findprice that finds the right price, except it does not check for quantity, units and stocklocation.
public static bool ShowPrice(Price price, PriceContext context, Product product, bool isInformative)
Parameters
price
Price- The price.
context
PriceContext- The price context.
product
Product- The product.
isInformative
bool- if set to
true
[is informative].
Returns
- bool
true
if the price should be shown,false
otherwise.
ShowPrice(Price, Product, Currency, User, bool, DateTime, Country)
[Obsolete("Use overload with PriceContext")]
public static bool ShowPrice(Price price, Product product, Currency currency, User user, bool isInformative, DateTime ordertime, Country country)
Parameters
price
Priceproduct
Productcurrency
Currencyuser
UserisInformative
boolordertime
DateTimecountry
Country