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.ccLogicCartPlace.checkCartForAsyncPlace
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> checkCartForAsyncPlace(Map<String, Object>)
Inputs (Required)
This method accepts the working Map<String, Object> after the ccrz.ccLogicCartPlace.processInput method completes.
This method requires either of the following keys in the working map:
- ccrz.ccApiCart.CART_ID
- String that specifies the Salesforce ID of the cart to convert.
- ccrz.ccApiCart.CART_ENCID
- String that specifies the encrypted ID of the cart to convert.
Inputs (Optional)
If the working map includes the following keys, this method evaluates them:
- ccrz.ccApiCart.FORCE_PLACE_SYNC
- Boolean
Value Usage true Place the order synchronously, regardless of the value of the ccrz.ccApiCart.PLACE_ASYNC input. false (default) Default logic determines whether to place the order synchronously or asynchronously. - ccrz.ccApiCart.PLACE_ASYNC
- Boolean
Value Usage true Place the order asynchronously by calling the ccrz.ccApiCart.placeAsync method. false (default) Place the order synchronously.
Logic Performed
This method completes the following actions:
- Evaluates whether any of the following criteria for synchronous cart pricing are satisfied:
- The ccrz.ccApiCart.FORCE_PLACE_SYNC input key is true.
- The buyer is a guest.
- The Cart Scale storefront configuration module's Enable Cart Scale setting (cs.enable) is false or null.
If any of these criteria are satisfied, this method sets ccrz.ccApiCart.PLACE_ASYNC to false, and the method exits. Otherwise, execution continues.
- Evaluates whether the ccrz.ccApiCart.PLACE_ASYNC input key already specifies a value.
- Completes the following actions when the Cart Scale storefront configuration module's
Enable Cart Scale setting (cs.enable) is
true:
- Finds the value of the Cart Scale storefront configuration module's Asynchronous Processing Threshold setting (cs.asyncthreshold).
- Passes ccrz.ccApiCart.CART_ID or ccrz.ccApiCart.CART_ENCID as input for the ccrz.ccApiCart.fetch method.
- Finds the value of the fetched ccrz__E_Cart__c record's ccrz__NumberofAllCartItems__c field.
- Compares the total number of cart items with the Asynchronous Processing Threshold value. When the number of cart items exceeds the processing threshold, the order is placed asynchronously.
Outputs
This method returns the working Map<String, Object>, and sets the following key:
- ccrz.ccApiCart.PLACE_ASYNC
- Boolean
Value Usage true The criteria determined that the order is placed asynchronously. This logic service provider skips the remaining methods in its logic chain, and calls ccrz.ccApiCart.placeAsync instead. false The criteria determined that the order is placed synchronously. This logic service provider's execution continues.