• Welcome to KonaKart Community Forum. Please login or sign up.
 

Adding multiple products to the cart

Started by rgayle, April 15, 2009, 05:51:13 am

Previous topic - Next topic

rgayle

the following code supposed to add two items to the shopping cart, but when I'm forwarded to the cart page, there is only one product, the second of the two.

               BasketMgr bm = kkAppEng.getBasketMgr();
               for (ProductIf bundleProd : kkAppEng.getProductMgr().getBundledProducts()) {
                    BasketIf b = new Basket();
                    b.setQuantity(Math.max(bundleProd.getQuantity(),1));
                    b.setProductId(bundleProd.getId());
                    bm.addToBasket(b,true);
                  }

what am I doing wrong?

trevor

Are you sure that there are two products? Have they both been added to the database? Try adding them manually through the application and see if it works.

rgayle

Thanks, I had not put this logic into the other AddtoCart java class.  (AddToCartSubmit) something like that.  Also, If I'd read the cart entries description of the product, I would have realized that it was not one of the ingredients, but the actual recipe product.

Thanks.