Package com.ateam.webstore.model

Examples of com.ateam.webstore.model.ProductsInCart


   
    if (req.getParameter(Parameters.REMOVE.getId()) != null) {
      String removeId = req.getParameter(Parameters.REMOVE.getId());
      l.info("removing cart item "+removeId+" for session: "+req.getSession().getId());
      ProductsInCartService pics = new ProductsInCartService();
      ProductsInCart pic = pics.getById(new Long(removeId));
      pics.remove(pic);
      updateCart();
    }
     
    CartView cv = new CartView(getMainView());
View Full Code Here


    l.info("adding product to cart for session: "+req.getSession().getId());

    l.fine("add prodId :"+prodId);   

    ProductsInCart prodInCart = new ProductsInCart(1, cart, new ProductService().getById(new Long(prodId)));
    cart.addProduct(prodInCart);
    service.store(cart);
   
    add.setResultView(getCartView());
   
View Full Code Here

            String[] parts = name.split("_");
            Integer quantity = Integer.parseInt(req.getParameter(name));           
            String id = parts[0];
            l.fine("updating qty for "+id);
            ProductsInCartService pics = new ProductsInCartService();
            ProductsInCart pic = pics.getById(new Long(id));
           
            if (quantity == 0) {
              pics.remove(pic);             
            }
            else {
              pic.setQuantity(quantity);
              pics.store(pic);
            }
          }
        }
        updateCart();
View Full Code Here

TOP

Related Classes of com.ateam.webstore.model.ProductsInCart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.