ccrz.ccLogicCartPriceAsync.applySubscriptionPercentages
Adjusts the price for a cart item that's a minor line item for a kit or dynamic kit that
defines a subscription term. This method applies the parent subscription's upfront and recurring
percentage discounts to the child cart item, which previously had only standard pricing logic
applied. This method executes only during the
recursive, asynchronous ccrz.ccApiCart.priceAsync
method calls.
Compatibility
This reference applies to:
Release | Managed Package Version | API Version |
---|---|---|
B2B Commerce for Visualforce Winter ’21 | 4.13 | 12 |
Signature
global virtual Map<String, Object> applySubscriptionPercentages(Map<String, Object>)
Inputs (Required)
This method accepts a Map<String, Object> from the ccrz.ccLogicCartPriceAsync.priceItem method. The map can include the following keys:
- ccrz.ccLogicCartPriceAsync.PRICE_ITEM_CART_ITEM
- ccrz__E_CartItem__c that's a minor line item under a kit or dynamic kit.
- ccrz.ccLogicCartPriceAsync.PRICE_ITEM_PARENT_ITEM
- The parent ccrz__E_CartItem__c of ccrz.ccLogicCartPriceAsync.PRICE_ITEM_CART_ITEM. This cart item must be a kit or dynamic kit that defines a subscription term.
- ccrz.ccLogicCartPriceAsync.PRICE_ITEM_SUBPRODTERM_MAP
- Map<String, Object> that describes the ccrz__E_SubProdTerm__c record that the cart item references.
Outputs
This method returns the input Map<String, Object> and updates the values of the following ccrz__E_CartItem__c fields.
ccrz__E_CartItem__c Field | Value |
---|---|
ccrz__Price__c | The standard price of the cart item, adjusted by the subscription's upfront (non-recurring) percentage. |
ccrz__RecurringPrice__c | The standard price of the cart item, adjusted by the subscription's recurring percentage. |
ccrz__RecurringPriceSubAmt__c | The recurring price multiplied by quantity. |
ccrz__SubAmount__c | The upfront price multiplied by quantity. |