The global method setSplitCartInfo is used to group the line items in the cart for pricing. You can define the parameters, namely the threshold and the split criteria based on which you want to split the line items in the cart through the API. If you do not define the parameters, the values of settings Split Cart Threshold and Split Cart Criteria Fields in Config System Properties are used to split the line items instead.
The list of API names of the fields to use as criteria.
SplitThreshold
Integer
The number of line items in a group.
Code Sample
The sample below enables you to set the values of Split Cart Threshold and Split Cart Criteria Fields to define the information required to split a cart.
//Setting Split info
Apttus_Config2.CustomClass.SplitCartInfo splitInfo = new Apttus_Config2.CustomClass.SplitCartInfo();
splitInfo.SplitCriteriaFields.add('Apttus_Config2_LocationId_c');
splitInfo.SplitThreshold = 10;
//Calling SplitInfo
// cartID can be Main Cart Id or Config Cart Id
ID cartID = 'a1I2f00000029Iy';
Apttus_Config2.CPQWebService.setSplitCartInfo(cartID , splitInfo);