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
contextPriceContext- Context information.
selectionPriceProductSelection- 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
productProduct- The product.
quantitydouble- The quantity.
variantIdstring- The variant ID.
currencyCurrency- The currency.
unitIdstring- The unit ID.
userUser- 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
productProduct- The product.
quantitydouble- The quantity.
variantIdstring- The variant ID.
currencyCurrency- The currency.
unitIdstring- The unit ID.
userUser- The user.
shopIdstring
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
productProduct- The product.
quantitydouble- The quantity.
variantIdstring- The variant ID.
currencyCurrency- The currency.
unitIdstring- The unit ID.
userUser- The user.
shopIdstringstockLocationStockLocation
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
contextPriceContext- Context information.
selectionPriceProductSelection- 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
productProduct- The product.
quantitydouble- The quantity.
variantIdstring- The variant id.
currencyCurrency- The currency.
unitIdstring- The unit id.
userUser- 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
productProduct- The product.
quantitydouble- The quantity.
variantIdstring- The variant id.
currencyCurrency- The currency.
unitIdstring- The unit id.
userUser- The user.
quantityAllVariantsdouble- 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
productProduct- The product.
quantitydouble- The quantity.
variantIdstring- The variant id.
currencyCurrency- The currency.
unitIdstring- The unit id.
userUser- The user.
quantityAllVariantsdouble- The quantity of all variants.
shopIdstring- 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
productProduct- The product.
quantitydouble- The quantity.
variantIdstring- The variant id.
currencyCurrency- The currency.
unitIdstring- The unit id.
userUser- The user.
quantityAllVariantsdouble- The quantity of all variants.
shopIdstring- The shopId.
stockLocationStockLocation- 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
contextPriceContext- The price context
selectionsIEnumerable<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
pricePrice- The price.
contextPriceContext- The price context.
productProduct- The product.
isInformativebool- if set to
true[is informative].
Returns
- bool
trueif the price should be shown,falseotherwise.
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
pricePriceproductProductcurrencyCurrencyuserUserisInformativeboolordertimeDateTimecountryCountry