public void addAllToCart()
    {
        for (Product item : searchResults) {
            Boolean selected = searchSelections.get(item);
            if (selected != null && selected) {
                searchSelections.put(item, false);
                cart.addProduct(item, 1);
            }
        }
    }
public void addAllToCart ( ) { for ( Product item : searchResults ) { Boolean selected = searchSelections . get ( item ) ; if ( selected != null && selected ) { searchSelections . put ( item , false ) ; cart . addProduct ( item , 1 ) ; } } }
Add many items to cart