// create the line items and add to order
Shopcart shopcart = (Shopcart) session.getAttribute(Constants.SHOPCART);
Iterator cartItems = shopcart.getItems().iterator();
ShopcartItem currentItem;
SalesOrderLineItem currentLineItem;
ProductOption currentOption;
// get a DAO for the new Stake
InternetProductOptionDAO optionDAO = new InternetProductOptionDAO();
while (cartItems.hasNext()) {
currentItem = (ShopcartItem) cartItems.next();
currentOption = optionDAO.findById(currentItem.getOptionId(),false);
currentLineItem =
new SalesOrderLineItem(
currentItem.getAmount(),
currentItem.getPrice(),
currentItem.getComment(),
currentOption);
newOrder.getLineItems().add(currentLineItem);