ccrz.ccLogicOrderReOrder.processOrderData
Copies data from the original order, order items, and order item groups to the
corresponding cart, cart items, and cart item groups. This method creates the cart-related
sObjects and assigns new external IDs.
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> processOrderData(Map<String, Object>)
Inputs (Required)
This method accepts the Map<String, Object> from the ccrz.ccLogicOrderReOrder.insertAddresses method.
This method requires the following keys in the working map:
- ccrz.ccApi.SUCCESS
- Boolean
Value Usage true The previous method in the logic chain completed successfully. This method executes. false This previous method in the logic chain failed. Execution skips this method, and continues to the next method in the logic chain. - ccrz.ccApiOrder.ORDERITEMSBYID
- Map<String, List<Map<String, Object>>>, keyed by parent ccrz__E_Order__c, where each Map<String, Object> represents a ccrz__E_OrderItem__c record to copy.
- ccrz.ccApiOrder.ORDERLIST
- List<Map<String, Object>>, where the Map<String, Object> represents the ccrz__E_Order__c record to copy.
- 'origAddressToNewId'
- Map<String, Object> that associates each billing and shipping address' original sfid to its new sfid.
Logic Performed
This method completes the following actions:
- Evaluates ccrz.ccApiOrder.ORDERITEMSBYID and creates an intermediate key, 'orderItemsById', for organizing the original order's items into major and minor line items.
- Creates a Map<String, Object> for the new ccrz__E_Cart__c record, and assigns a randomized cartId value using the Crypto.getRandomInteger Apex method.
- Evaluates 'origAddressToNewId' and assigns the cart's ccrz__BillTo__c and ccrz__ShipTo__c contact addresses.
- Evaluates the order's ccrz__E_OrderItemGroup__c records, and creates corresponding ccrz__E_CartItemGroup__c records. This method assigns each group a randomized cartItemGroupId value using the Crypto.getRandomInteger Apex method.
- Evaluates the order's ccrz__E_OrderItem__c records, and creates corresponding ccrz__E_CartItem__c records. This method assigns each item a randomized cartItemId value using the Crypto.getRandomInteger Apex method.
- Prepares lists of ccrz__E_Cart__c, ccrz__E_CartItem__c, and ccrz__E_CartItemGroup__c sObjects to insert.
- Assigns cart items that are minor line items, such as component products of composite products (bundles, kits, and so on), to a separate list for upsert.
Outputs
This method returns the working Map<String, Object>, and sets the following keys:
- ccrz.ccApiCart.CART_OBJLIST
- List<ccrz__E_Cart__c> that contains the cart record to create.
- 'cartItemsToInsert'
- List<ccrz__E_CartItem__c> of sObjects, with external ID set, ready to insert.
- 'groupsToInsert'
- List<ccrz__E_CartItemGroup__c> of sObjects, with external ID set, ready to insert.
- 'upsertList'
- List<ccrz__E_CartItem__c> of sObjects for child cart items, such as component products for composite products.