ccrz.ccLogicCartCreate.createCartItems

Creates the line data for the cart's items.

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

Inputs (Required)

This method accepts the Map<String, Object> from the ccrz.ccLogicCartCreate.insertCarts method.

This method requires the following keys in the working map:

'cartItemsToCreate'
List<Map<String, Object>> where each Map<String, Object> represents data for a ccrz__E_CartItem__c associated with the cart.

The ccrz.ccLogicCartCreate.processCartData method created this key when the original input's ccrz.ccApiCart.CART_OBJLIST key included the ECartItemsS subkey.

Note

'newCartObjects'
List<ccrz__E_Cart__c> that contains the inserted cart sObject.

Outputs

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

'cartItemsToCreate'
List<Map<String, Object>> where each Map<String, Object> describes data for a ccrz__E_CartItem__c associated with the cart. This method sets the following key values:
ccrz.ccApiCart.LINE_DATA_QUANTITY
Integer that specifies the quantity for the product to add to the cart.
ccrz.ccApiCart.LINE_DATA_PRODUCT_SFID
Salesforce ID for the product to add to the cart.

The ccrz.ccLogicCartCreate.insertCartItems method uses the content in 'cartItemsToCreate' as the ccrz.ccApiCart.LINE_DATA input for a ccrz.ccApiCart.addTo call.

Note