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.ccLogicCartPrice.priceItem

Begins the For loop within the ccrz.ccLogicCartPrice.applyPricing method by evaluating the current cart item and determining the appropriate pricing logic.

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> priceItem(Map<String, Object>)

Inputs (Required)

This method accepts the pricingInputs Map<String, Object> from the ccrz.ccLogicCartPrice.applyPricing method. The map can include the following keys:

'cartItem'
ccrz__E_CartItem__c to evaluate.
ccrz.ccApiProduct.PRODUCTPRICINGDATA
Map<String, Object> of pricing data for all queried products. This map can contain seller, subscription term, attribute, and standard pricing information for the queried products.
'parentItem'
The parent ccrz__E_CartItem__c of 'cartItem'.

Outputs

This method returns the input Map<String, Object>, updated with the results of the appropriate pricing logic:

Scenario Result
ccrz.ccApiProduct.PRODUCTPRICINGDATA is empty. The current user isn't entitled to the product. This method sets the cart item's price to -1, which causes the ccrz.ccLogicCartPrice.checkCartItemValidity method to set the cart item's ccrz__ItemStatus__c to Invalid.
ccrz.ccApiProduct.PRODUCTPRICINGDATA contains seller data Set the cart item's price from the seller's price list item. If the seller isn't listed, this cart item becomes invalid.
The cart item's ccrz__CartItemType__c is Major and the cart item has a value for ccrz__SubProdTerm__c. Call the ccrz.ccLogicCartPrice.evaluateSubProdtermPricing method to determine the cart item's price.
The cart item has a value for ccrz__SelectedAttr__c. Evaluate whether ccrz.ccApiProduct.PRODUCTPRICINGDATA includes attribute pricing data. If so, call the ccrz.ccLogicCartPrice.priceAttributeItem method to determine the cart item's price.
The cart item's ccrz__PricingType__c is ATTRGROUP. Set the following fields on the ccrz__E_CartItem__c record:
  • ccrz__OriginalItemPrice__c is 0.00
  • ccrz__Price__c is 0.00
  • ccrz__Quantity__c is 1
  • ccrz__SubAmount__c is 0.00
The cart item has a value for ccrz__PricingModifierTypes__c. Evaluate the product's pricing tiers, and apply the correct price based on the item's quantity.
The cart item's ccrz__CartItemType__c is Minor and the cart item's parent has a subscription term. Call the ccrz.ccLogicCartPrice.applySubscriptionPercentages method to update the cart item's price.
All other scenarios Apply standard pricing and set the following fields on the ccrz__E_CartItem__c record:
  • ccrz__OriginalItemPrice__c
  • ccrz__Price__c
  • ccrz__SubAmount__c