Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

ccrz.ccLogicProductPricing.evaluateBasicPricing

Evaluates criteria for pricing a standard product, including entitled price lists, base price lists, seller data, and subscription data. This method also calculates a buyer's savings from an entitled price list compared to a base price list.

Compatibility

This reference applies to:

Release Managed Package Version API Version
B2B Commerce for Visualforce Winter ’21 4.13 12
B2B Commerce for Visualforce Spring ’20 4.12 11
B2B Commerce for Visualforce Summer ’19 4.11 10
B2B Commerce for Visualforce Spring ’19 4.10 9
B2B Commerce for Visualforce Summer ’18 4.9 8

Signature

global virtual Map<String, Object> evaluateBasicPricing(Map<String, Object>)

Inputs (Required)

This method accepts the working Map<String, Object> from the ccrz.ccLogicProductPricing.evaluatePricing method.

This method requires the following keys in the working map:

ccrz.ccApiPriceList.PRICELISTITEMS
Map<String, Map<String, List<Map<String, Object>>>> where:
  • The outer Map is keyed by a string that specifies a product ID.
  • Each second-level Map is keyed by a string that specifies a type of price list item: 'entitledPLIs', 'sellersPLIs', or 'subProdTermPLIs'.
  • Each inner List<Map<String, Object>> is a list of entitled, seller, or subscription price list items.
ccrz.ccApiPriceList.PRICELISTS
Map<String, Object> of ccrz__E_PriceList__c data, keyed by ID.
ccrz.ccApiProduct.EVALUATIONMODE
String that specifies one of the following constants, which references the price list selection method for the buyer's account group:
Value Usage
ccrz.ccApiProduct.BESTPRICE (default) B2B Commerce for Visualforce evaluates all price lists assigned to the account group, and applies the lowest price available for each product.
ccrz.ccApiProduct.SEQUENCE B2B Commerce for Visualforce evaluates the Sequence values on each assigned price list's Account Group Price List related record. For the Account Group Price List with the lowest Sequence value, B2B Commerce applies that price list's price.
'basePriceListItems'
Map<String, Object> of ccrz__E_PriceListItem__c data, keyed by ID, that belong to the storefront's base price list.
'completeInputData'
Map<String, Object> that contains a copy of all the input keys and values passed to this method.
'product'
ccrz__E_Product__c to price.

Inputs (Optional)

If the working map includes the following key, this method evaluates it:

ccrz.ccApiAttribute.ATTRIBUTEIDS
Map<String, Object> where each key is a parent attribute ID and each value is a List<String> of child attribute IDs:
new Map<String, Object>{
     'ParentAttributeID1' => new List<String>{'ChildAttributeID1', 'ChildAttributeID2', 'ChildAttribute3'},
     'ParentAttributeID2' => new List<String>{'ChildAttributeID4', 'ChildAttributeID6', 'ChildAttribute5'}
}
ccrz.ccApiProduct.INCLUDE_ATTRIBUTE_PRICING
Boolean
Value Usage
true Query for ccrz__E_Attribute__c records that are related to each product, and return the attribute pricing JSON applied to the product's entitled price list item.
false (default) Don't return any attribute pricing.
ccrz.ccApiProduct.PARSE_ATTRIBUTE_PRICING
Boolean
Value Usage
true (default) Parse the attribute pricing JSON. By default, this method returns true unless the input data explicitly sets false for this key.
false Skip attribute pricing.
ccrz.ccApiSubProdTerm.SPTBYPRODID
Map<String, Object> that maps subscription terms to their product IDs.

Logic Performed

This method completes the following actions:

  1. If any sellers data exists for the product, this method calls the ccrz.ccLogicProductPricing.evaluateSellersPricing method to handle the sellers pricing.
  2. If any subscription data exists for the product, this method calls the ccrz.ccLogicProductPricing.evaluateSubProdTermPricing inner method to handle the subscription pricing.
  3. To evaluate product's pricing in the buyer's entitled price list, this method calls the ccrz.ccLogicProductPricing.determinePrice inner method.
  4. To evaluate product's pricing in the storefront's base price list, this method calls the ccrz.ccLogicProductPricing.determinePrice inner method.
  5. Calculates the buyer's savings from the entitled price list compared to the base price list.

Outputs

This method returns the working Map<String, Object>, and sets the following keys:

ccrz.ccApiProduct.PRODUCTPRICINGDATA
Map<String, Object> of product pricing data, keyed by product ID, that results from the inner method calls.