When pricing is obtained using global context price list selections, CSC takes advantage of a core commerce feature that allows the price lists to be passed into the pricing engine to override the core behavior that uses the active profile’s assigned price list. The list price list and sale price list can be specified in an extra parameter map that is passed to the pricing operation API. The pricing engine uses these price lists in place of the profile’s assigned price list. The list price list and sale price list that are loaded in the global context are passed in to the pricing engine using the extra parameter map.

The following core Commerce PricingTools API is used for pricing orders. Note the Map parameter that is included on the API:

public OrderPriceInfo priceOrderTotal(Order pOrder,
                           PricingModelHolder pPricingModels,
                           Locale pLocale,
                           RepositoryItem pProfile,
                           Map pExtraParameters)

The CSRAgentTools API generates a Map that contains the ids of the current global context price list selections. This API is used by CSC to generate the extra parameter map for pricing operations. CSC has also extended createRepriceParameterMap of all the PurchaseProcessFormHandlers to call this API:

public Map addPriceListParameter(Map pExtraParameters)

The CSRAgentTools API is used for pricing an order that will call addPriceListParameter as part of the process:

public void repriceOrder(String pRepricingOperation, Order pOrder,
           PricingModelHolder pUserPricingModels,
           Locale pLocale, RepositoryItem pCustomerProfile,
           RepositoryItem pAgentProfile,Map pExtraParameters,
           PipelineErrorHandler pErrorHandler)

CSREnvironmentTools contains the API for accessing the global context price list selections, setting new global context price list selections and extracting a price list from an order:

public RepositoryItem getCurrentPriceList()
public RepositoryItem getCurrentSalePriceList()

public void setCurrentPriceList(RepositoryItem pPriceList)
public void setCurrentSalePriceList(RepositoryItem pPriceList)

public RepositoryItem getListPriceListFromOrder(Order pOrder)
public RepositoryItem getSaleListPriceListFromOrder(Order pOrder)
loading table of contents...