November Happy Hour will be moved to Thursday December 5th.

Class PricingExtensions

Gets prices for a IPricing implementation.

Inheritance
System.Object
PricingExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Catalog.ContentTypes
Assembly: EPiServer.Business.Commerce.dll
Version: 12.17.2
Syntax
[Obsolete("This class is no longer used. Will remain at least until August 2019.")]
public static class PricingExtensions

Methods

GetCustomerPrices(IPricing)

Gets the prices for the current user.

Declaration
public static ItemCollection<Price> GetCustomerPrices(this IPricing pricing)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

Returns
Type Description
ItemCollection<Price>

Price definition for the catalog entry

Remarks

This method will get the currency for the current user on current market.

GetCustomerPrices(IPricing, ReadOnlyPricingLoader)

Gets the prices for the current user.

Declaration
public static ItemCollection<Price> GetCustomerPrices(this IPricing pricing, ReadOnlyPricingLoader pricingLoader)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

ReadOnlyPricingLoader pricingLoader

The pricing loader to use to receive the prices.

Returns
Type Description
ItemCollection<Price>

Price definition for the catalog entry

Remarks

This method will get the currency for the current user on current market.

GetCustomerPrices(IPricing, Currency, Nullable<Decimal>, Nullable<Boolean>)

Gets the prices for the current user.

Declaration
public static ItemCollection<Price> GetCustomerPrices(this IPricing pricing, Currency currency, decimal? quantity, bool? returnCustomerPricing)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

Currency currency

The currency to use when receiving the price. Use Currency.Empty to get the current currency for the user.

System.Nullable<System.Decimal> quantity

The quantity to filter on. If null, prices for all quantities will be returned.

System.Nullable<System.Boolean> returnCustomerPricing

True if customer pricing should be returned. If null, the parameter will be true if user has logged in to the site.

Returns
Type Description
ItemCollection<Price>

Price definition for the catalog entry

Remarks

This method will use the current market when receiving the prices.

GetCustomerPrices(IPricing, Currency, Nullable<Decimal>, Nullable<Boolean>, ReadOnlyPricingLoader)

Gets the prices for the current user.

Declaration
public static ItemCollection<Price> GetCustomerPrices(this IPricing pricing, Currency currency, decimal? quantity, bool? returnCustomerPricing, ReadOnlyPricingLoader pricingLoader)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

Currency currency

The currency to use when receiving the price. Use Currency.Empty to get the current currency for the user.

System.Nullable<System.Decimal> quantity

The quantity to filter on. If null, prices for all quantities will be returned.

System.Nullable<System.Boolean> returnCustomerPricing

True if customer pricing should be returned. If null, the parameter will be true if user has logged in to the site.

ReadOnlyPricingLoader pricingLoader

The pricing loader to use to receive the prices.

Returns
Type Description
ItemCollection<Price>

Price definition for the catalog entry

Remarks

This method will use the current market when receiving the prices.

GetDefaultPrice(IPricing)

Gets the default price from the price service.

Declaration
public static Price GetDefaultPrice(this IPricing pricing)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

Returns
Type Description
Price

Price definition for the catalog entry

Remarks

This method will get the currency for the current user.

GetDefaultPrice(IPricing, ReadOnlyPricingLoader)

Gets the default price from the price service.

Declaration
public static Price GetDefaultPrice(this IPricing pricing, ReadOnlyPricingLoader pricingLoader)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

ReadOnlyPricingLoader pricingLoader

The pricing loader to use to receive the price.

Returns
Type Description
Price

Price definition for the catalog entry

Remarks

This method will get the currency for the current user.

GetDefaultPrice(IPricing, Currency)

Gets the default price from the price service.

Declaration
public static Price GetDefaultPrice(this IPricing pricing, Currency currency)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

Currency currency

The currency to use when receiving the price.

Returns
Type Description
Price

Price definition for the catalog entry

GetDefaultPrice(IPricing, Currency, ReadOnlyPricingLoader)

Gets the default price from the price service.

Declaration
public static Price GetDefaultPrice(this IPricing pricing, Currency currency, ReadOnlyPricingLoader pricingLoader)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

Currency currency

The currency to use when receiving the price.

ReadOnlyPricingLoader pricingLoader

The pricing loader to use to receive the price.

Returns
Type Description
Price

Price definition for the catalog entry

GetDefaultPrice(IPricing, DateTime)

Gets the default price from the price service.

Declaration
public static Price GetDefaultPrice(this IPricing pricing, DateTime validOn)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

System.DateTime validOn

The date and time, in UTC, that the price is valid on.

Returns
Type Description
Price

Price definition for the catalog entry

GetDefaultPrice(IPricing, DateTime, ReadOnlyPricingLoader)

Gets the default price from the price service.

Declaration
public static Price GetDefaultPrice(this IPricing pricing, DateTime validOn, ReadOnlyPricingLoader pricingLoader)
Parameters
Type Name Description
IPricing pricing

The entry implementing IPricing.

System.DateTime validOn

The date and time, in UTC, that the price is valid on.

ReadOnlyPricingLoader pricingLoader

The pricing loader to use to receive the price.

Returns
Type Description
Price

Price definition for the catalog entry

GetPrices(IPricing)

Gets the prices for all markets for all customers.

Declaration
public static ItemCollection<Price> GetPrices(this IPricing pricing)
Parameters
Type Name Description
IPricing pricing

The pricing implementation

Returns
Type Description
ItemCollection<Price>

Collection of prices.

Remarks

This method uses the EPiServer.ServiceLocation.ServiceLocator to resolve the PricingLoader, which will be send to the method that contains an pricing loader.

GetPrices(IPricing, ReadOnlyPricingLoader)

Gets the prices

Declaration
public static ItemCollection<Price> GetPrices(this IPricing pricing, ReadOnlyPricingLoader pricingLoader)
Parameters
Type Name Description
IPricing pricing

The pricing implementation

ReadOnlyPricingLoader pricingLoader

The pricing loader.

Returns
Type Description
ItemCollection<Price>

Collection of prices.

Remarks

This method will not filter on MarketId or CustomerPricing.

GetPrices(IPricing, ReadOnlyPricingLoader, MarketId, CustomerPricing)

Gets the prices

Declaration
public static ItemCollection<Price> GetPrices(this IPricing pricing, ReadOnlyPricingLoader pricingLoader, MarketId marketId, CustomerPricing customerPricing)
Parameters
Type Name Description
IPricing pricing

The pricing implementation

ReadOnlyPricingLoader pricingLoader

The pricing loader.

MarketId marketId

The market to get prices for.

CustomerPricing customerPricing

The customer pricing type to fetch prices for.

Returns
Type Description
ItemCollection<Price>

Collection of prices.

GetPrices(IPricing, ReadOnlyPricingLoader, MarketId, IEnumerable<CustomerPricing>)

Gets the prices

Declaration
public static ItemCollection<Price> GetPrices(this IPricing pricing, ReadOnlyPricingLoader pricingLoader, MarketId marketId, IEnumerable<CustomerPricing> customerPricings)
Parameters
Type Name Description
IPricing pricing

The pricing implementation

ReadOnlyPricingLoader pricingLoader

The pricing loader.

MarketId marketId

The market to get prices for.

System.Collections.Generic.IEnumerable<CustomerPricing> customerPricings

List of the customer pricing types to fetch prices for.

Returns
Type Description
ItemCollection<Price>

Collection of prices.

GetPrices(IPricing, MarketId, CustomerPricing)

Gets the prices

Declaration
public static ItemCollection<Price> GetPrices(this IPricing pricing, MarketId marketId, CustomerPricing customerPricing)
Parameters
Type Name Description
IPricing pricing

The pricing implementation

MarketId marketId

The market to get prices for.

CustomerPricing customerPricing

The customer pricing type to fetch prices for.

Returns
Type Description
ItemCollection<Price>

Collection of prices.

Remarks

This method uses the EPiServer.ServiceLocation.ServiceLocator to resolve the PricingLoader, which will be send to the method that contains an pricing loader.