public static ShoppingCartItem makeItem(Integer cartLocation,String itemType,String itemDescription,String productCategoryId,BigDecimal basePrice,BigDecimal selectedAmount,BigDecimal quantity,Map<String,Object> attributes,String prodCatalogId,ShoppingCart.ShoppingCartItemGroup itemGroup,LocalDispatcher dispatcher,ShoppingCart cart,Boolean triggerExternalOpsBool) throws CartItemModifyException {
  Delegator delegator=cart.getDelegator();
  ShoppingCartItem newItem=new ShoppingCartItem(delegator,itemType,itemDescription,productCategoryId,basePrice,attributes,prodCatalogId,cart.getLocale(),itemGroup);
  if (cartLocation == null) {
    cart.addItemToEnd(newItem);
  }
 else {
    cart.addItem(cartLocation.intValue(),newItem);
  }
  boolean triggerExternalOps=triggerExternalOpsBool == null ? true : triggerExternalOpsBool.booleanValue();
  try {
    newItem.setQuantity(quantity,dispatcher,cart,triggerExternalOps);
  }
 catch (  CartItemModifyException e) {
    cart.removeEmptyCartItems();
    throw e;
  }
  if (selectedAmount != null) {
    newItem.setSelectedAmount(selectedAmount);
  }
  return newItem;
}

public static ShoppingCartItem makeItem ( Integer cartLocation , String itemType , String itemDescription , String productCategoryId , BigDecimal basePrice , BigDecimal selectedAmount , BigDecimal quantity , Map < String , Object > attributes , String prodCatalogId , ShoppingCart . ShoppingCartItemGroup itemGroup , LocalDispatcher dispatcher , ShoppingCart cart , Boolean triggerExternalOpsBool ) throws CartItemModifyException { Delegator delegator = cart . getDelegator ( ) ; ShoppingCartItem newItem = new ShoppingCartItem ( delegator , itemType , itemDescription , productCategoryId , basePrice , attributes , prodCatalogId , cart . getLocale ( ) , itemGroup ) ; if ( cartLocation == null ) { cart . addItemToEnd ( newItem ) ; } else { cart . addItem ( cartLocation . intValue ( ) , newItem ) ; } boolean triggerExternalOps = triggerExternalOpsBool == null ? true : triggerExternalOpsBool . booleanValue ( ) ; try { newItem . setQuantity ( quantity , dispatcher , cart , triggerExternalOps ) ; } catch ( CartItemModifyException e ) { cart . removeEmptyCartItems ( ) ; throw e ; } if ( selectedAmount != null ) { newItem . setSelectedAmount ( selectedAmount ) ; } return newItem ; }
makes a non - product shoppingcartitem and adds it to the cart . note : this is only for non - product items ; items without a product entity ( work items , bulk items , etc )
