required = false)
}),
@Jpf.Forward(name="cart", path="cart.jsp")
})
protected Forward addItemToCart(CartForm form) throws InvalidIdentifierException {
Cart cart = form.getCart();
if (cart.containsItemId(form.getWorkingItemId()))
{
cart.incrementQuantityByItemId(form.getWorkingItemId());
}
else
{
Item toAddItem = _catalogControl.getItem(form.getWorkingItemId());
if (toAddItem != null)
{
//toAddItem.setProduct(_currentProduct);
cart.addItem(toAddItem);
}
/* todo: error handling path */
}
return new Forward("cart", "product", _currentProduct);