Pricing service methods
Service providers are wrapper objects designed to make it easier to interact with Connect pipelines. The providers implement no logic other than calling Connect pipelines. All of the business logic is implemented in the pipeline processors.
The Pricing service provider contains the following methods for interacting with pricing data.
GetProductPrices method
GetProductPrices method
|
Description: |
Gets the prices for a specific product. | |
|
Usage: |
Called when Sitecore needs the prices for a specific product. | |
|
Signature: |
| |
|
Parameters: | ||
|
|
Required. | |
|
|
Prices typically vary depending on the actual user. | |
|
|
Required. | |
|
|
Prices often depend on the location. Location can be a city or a state. | |
|
|
If not specified, quantity is assumed to be 1. | |
|
|
Needed when campaigns promote products at discount prices within a certain period of time. | |
|
|
Multishop support. | |
|
|
List of the types of prices to retrieve. If not specified, only the base/list price is returned. Examples include list, break, and sale prices. The actual | |
|
Returns: | ||
|
|
A collection of price objects. | |
|
|
Collection of messages from the external system. This is how error conditions can be reported. | |
|
Exceptions: | ||
|
No exceptions are thrown by this method. | ||
Usage example:
GetProductBulkPrices method
GetProductBulkPrices method
|
Description: |
Gets the bulk prices for a specific product. | |
|
Usage: |
Called when Sitecore needs the break prices for a specific product. | |
|
Signature: |
| |
|
Parameters: | ||
|
|
Required. | |
|
|
Prices typically vary depending on the actual user. | |
|
|
Required. | |
|
|
Prices often depend on the location. Location can be a city or a state. | |
|
|
If not specified, quantity is assumed to be 1. | |
|
|
Needed when campaigns promote products at discount prices within a certain period of time. | |
|
|
Multishop support. | |
|
Returns: | ||
|
|
A collection of price objects. | |
|
|
Collection of messages from the external system. This is how error conditions can be reported. | |
|
Exceptions: | ||
|
No exceptions are thrown by this method. | ||
Usage example:
GetCartTotal method
GetCartTotal method
|
Description: |
Gets the price for a specific cart. | |
|
Usage: |
Called when Sitecore needs the price for a specific cart. | |
|
Signature: |
| |
|
Parameters: | ||
|
|
Required. | |
|
|
Prices typically vary depending on the actual user. | |
|
|
Required. | |
|
|
Prices often depend on the location. Location can be a city or a state. | |
|
|
Multishop support. | |
|
|
Needed when campaigns promote products at discount prices within a certain period of time. | |
|
Returns: | ||
|
|
An instance of a Total. | |
|
|
Collection of messages from the external system. This is how error conditions can be reported. | |
|
Exceptions: | ||
|
No exceptions are thrown by this method. | ||
Usage example:
GetSupportedCurrencies method
GetSupportedCurrencies method
|
Description: |
Gets a list of currencies supported by the ECS. | |
|
Usage: |
Called when Sitecore needs the list of supported currencies. | |
|
Signature: |
| |
|
Parameters: | ||
|
ShopName – Mandatory The name of the shop. | ||
|
Returns: | ||
|
IReadOnlyCollection<string> – A list of all supported currency codes. | ||
|
SystemMessages - Collection of messages from the external system. | ||
|
Exceptions: | ||
|
No exceptions are thrown by this method. | ||
Usage example:
CurrencyChosen method
CurrencyChosen method
|
Description: |
Raises the Currency Chosen page event . | |
|
Usage: |
Called when Sitecore needs to raise the Currency Chosen event. | |
|
Signature: |
| |
|
Parameters: | ||
|
ShopName – Mandatory The name of the shop. | ||
|
ChosenCurrency – Mandatory The chosen currency code. | ||
|
Returns: | ||
|
SystemMessages - Collection of messages from the external system. | ||
|
Exceptions: | ||
|
No exceptions are thrown by this method. | ||
Usage example:
GetEligiblePromotionIds method
GetEligiblePromotionIds method
|
Description: |
Retrieves the IDs of promotions that can be applied to a product . | |
|
Usage: |
Called to retrieve the IDs of promotions that can be applied to a product, for example, on the product details page. | |
|
Signature: |
| |
|
Parameters: | ||
|
Shop – Mandatory The target shop. | ||
|
ProductId – Mandatory The ID of the product for which promotions should be retrieved. | ||
|
TargetTime – Optional The time context that will be used to determine which promotions are eligible. | ||
|
CustomerId – Optional The ID of the customer for which the promotions are being retrieved. | ||
|
Returns: | ||
|
PromotionIds - Collection containing the IDs of the promotions that are applicable to the product. | ||
|
SystemMessages - Collection of messages from the external system. | ||
|
Exceptions: | ||
|
No exceptions are thrown by this method. | ||
Usage example:
GetProductPromotionDescription method
GetProductPromotionDescription method
|
Description: |
Retrieves the description of a list of promotions for a product. | |
|
Usage: |
Called to retrieve the description of a list of promotions for display on the site. | |
|
Signature: |
| |
|
Parameters: | ||
|
Shop – Mandatory The target shop. | ||
|
PromotionIds – Mandatory The IDs of the promotions to retrieve. | ||
|
CustomerId – Optional The ID of the customer for which the promotions are being retrieved. | ||
|
Returns: | ||
|
Promotions - Collection containing the requested promotions. | ||
|
SystemMessages - Collection of messages from the external system. | ||
|
Exceptions: | ||
|
No exceptions are thrown by this method. | ||
Usage example: