Splitting a Smart Cart
This global method splits the line items in the cart into groups in a Smart Cart flow.
API |
Signature |
---|---|
splitCart |
static Id splitCart(Id cartId) |
Request Parameter |
|||
---|---|---|---|
Name |
Type |
Required? |
Description |
cartID | ID |
Yes |
The Id of the cart to be split. |
Response Parameter |
||
---|---|---|
Field |
Type |
Description |
jobId | ID |
The Id of the job executed to split the cart. |
Code Sample
This sample enables you to splits the line items in the cart into groups in a Smart Cart flow. When the method is executed, the task pending flag is set to true on the cart passed as the parameter. After the line items are split into groups, the flag is set to false.
//Api to split large cart (pass in either Main Cart Id or Config Cart Id). This would set the task pending flag on the cart passed as the parameter (either main or config). When the split is completed, the flag is cleared. Note that it will call the pricing once split is done.
ID jobId = Apttus_Config2.BatchJobService.splitCart(mainOrConfigCartId);