Calculating a sellable item sell price
The sellable item sell price is calculated in the ICalculateSellableItemSellPricePipeline
plugin.
To calculate the sell price:
-
Find the
PriceCardPolicy
(new Policy) in the SellableItem policies list.The
PriceCardPolicy
must contain the logical name of a PriceCard (note that the same logically named price card can exist in multiple price books). -
If there is no
PriceCardPolicy
, search for a PriceCard using the tagging. -
Resolve the PriceBook to use by loading the associated catalog. The identifier for the catalog is passed in to the call (new Pipeline - GetCatalog).
-
Check that there is a new attribute on the catalog (PriceBook - string with Id fragment to PriceBook).
-
Load the PriceCard instance using the PriceBook and the logical PriceCard name.
-
Resolve the proper PriceSnapshot to use by filtering out those with dates that are superseded by other PriceSnapshots to find the single PriceSnapshot that should apply.
-
In the PriceSnapshot, resolve the available PriceTiers by filtering on the currency passed into the call.
-
Calculate the SellPrice (
purchaseOptionMoneyPolicy.SellPrice
) using an assumed quantity of 1. -
Copy the filtered PriceSnapshot and PriceTiers into the SellableItem so it can be used in later calculations.
The following messages are generated when calculating the sell price:
Message |
Circumstance |
---|---|
|
The SellableItem has a Sample Item AW051-14 (no variation) Sample Item AW055-01,33 (with variation) Note For a PriceSnapshot to be valid, it must have a valid date. Price tier must consist of the desired currency and a tier quantity of 1. |
|
The SellableItem does not have a Note This message relates to the Price card snapshot from the tags, with a valid date and currency as well as a Tier quantity of 1. A snapshot is resolved if it matches at least one of the item tags, has a quantity of 1, and it has a valid date and currency. |
|
The SellableItem has no SellPrice but has a valid ListPrice, so the ListPrice is copied to the SellPrice. |