Bestellen?Anzahl:Produkt:Einzelpreis:
<%
// Get app instance
PizzaApplication app = PizzaServiceApplication.getInstance(application);
// Get Iterator
Iterator iterator = app.getAvailableProducts();
// "Walk" through all products and unmark them as ordered
while (iterator.hasNext()) {
// Get product instance
Product product = iterator.next();
// Get basket instance
Basket basket = ItemBasket.getInstance(session);
// Create an item instance form this product
AddableBasketItem item = basket.getItem(product);
// Has it been already added to the basket?
if (item != null) {
// Some nice output ...
%>
Warenkorb<%=item.getAmount()%><%=product.getTitle()%><%=product.getPrice()%>
<%
// Then skip this item
continue;
}
// Unmark as ordered
app.unmarkProductAsOrdered(product, session);
%>
<%=product.getTitle()%>
<%=product.getPrice()%>
<%
}
%>