Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.Cart


    }
   
    public OrderCustomer buildAndSaveNewOrder(final RequestData requestData) throws Exception {
        final HttpServletRequest request = requestData.getRequest();
        final Customer customer = requestData.getCustomer();
        final Cart cart = requestData.getCart();
       
        OrderCustomer orderCustomer = checkoutService.checkout(customer, cart);
       
        requestUtil.deleteCurrentCartAndSaveEngineSession(request);
View Full Code Here


  @RequestMapping(value = FoUrls.CART_DETAILS_URL, method = RequestMethod.GET)
  public ModelAndView displayCartDetails(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.CART_DETAILS.getVelocityPage());

        final RequestData requestData = requestUtil.getRequestData(request);
        final Cart currentCart = requestData.getCart();
       
        // SANITY CHECK
        if (currentCart != null && currentCart.getTotalCartItems() == 0) {
            String fallbackUrl = urlService.generateUrl(FoUrls.HOME, requestUtil.getRequestData(request));
            String lastUrl = requestUtil.getLastRequestForEmptyCartUrl(request, fallbackUrl);
            return new ModelAndView(new RedirectView(lastUrl));
        }
       
View Full Code Here

    public ModelAndView submitOrderDelivery(final HttpServletRequest request, final HttpServletResponse response, @Valid CartForm cartForm,
                                            BindingResult result, ModelMap modelMap) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
       
        // SANITY CHECK
        final Cart currentCart = requestData.getCart();
        if (currentCart != null && currentCart.getTotalCartItems() == 0) {
            String fallbackUrl = urlService.generateUrl(FoUrls.HOME, requestUtil.getRequestData(request));
            String lastUrl = requestUtil.getLastRequestForEmptyCartUrl(request, fallbackUrl);
            return new ModelAndView(new RedirectView(lastUrl));
        }
       
View Full Code Here

    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.CART_ORDER_PAYMENT.getVelocityPage());

        final RequestData requestData = requestUtil.getRequestData(request);

        // SANITY CHECK: EMPTY CART
    final Cart currentCart = requestData.getCart();
    if(currentCart != null && currentCart.getTotalCartItems() == 0){
      return new ModelAndView(new RedirectView(urlService.generateUrl(FoUrls.CART_DETAILS, requestUtil.getRequestData(request))));
    }

        // SANITY CHECK: DELIVERY METHODS
        if(currentCart != null && currentCart.getDeliveryMethods().isEmpty()){
            return new ModelAndView(new RedirectView(urlService.generateUrl(FoUrls.CART_DELIVERY, requestUtil.getRequestData(request))));
        }

        // SANITY CHECK: ADDRESSES
        if(currentCart != null && (currentCart.getBillingAddressId() == null || currentCart.getShippingAddressId() == null)){
            return new ModelAndView(new RedirectView(urlService.generateUrl(FoUrls.CART_DELIVERY, requestUtil.getRequestData(request))));
        }

    final CartViewBean cartViewBean = frontofficeViewBeanFactory.buildViewBeanCart(requestUtil.getRequestData(request), currentCart);
    // HIDE PROMO CODE PART
View Full Code Here

                BindingResult result, ModelMap modelMap) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea marketArea = requestData.getMarketArea();
       
         // SANITY CHECK
        final Cart currentCart = requestData.getCart();
        if(currentCart.getTotalCartItems() == 0){
            return new ModelAndView(new RedirectView(urlService.generateUrl(FoUrls.CART_DETAILS, requestUtil.getRequestData(request))));
        }
       
    if (result.hasErrors()) {
      return displayOrderPayment(request, response);
View Full Code Here

        final String productSkuCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_CART_ITEM_SKU_CODE);
        final FoCheckoutPojo checkout = new FoCheckoutPojo();
        try {
            webManagementService.deleteCartItem(requestData, productSkuCode);
           
            final Cart cart = requestData.getCart();
            if(cart != null
                    && cart.getTotalCartItems() == 0){
                FoMessagePojo errorMessage = new FoMessagePojo();
                errorMessage.setId("warning-empty-cart");
                errorMessage.setMessage("Your cart is empty");
                checkout.getErrorMessages().add(errorMessage);
            }
View Full Code Here

    public ModelAndView displayOrderDelivery(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.CART_DELIVERY.getVelocityPage());

        // SANITY CHECK
        final RequestData requestData = requestUtil.getRequestData(request);
        final Cart currentCart = requestData.getCart();
        if (currentCart != null && currentCart.getTotalCartItems() == 0) {
            return new ModelAndView(new RedirectView(urlService.generateUrl(FoUrls.CART_DETAILS, requestUtil.getRequestData(request))));
        }

        final CartViewBean cartViewBean = frontofficeViewBeanFactory.buildViewBeanCart(requestUtil.getRequestData(request), currentCart);
        modelAndView.addObject(ModelConstants.CART_VIEW_BEAN, cartViewBean);
View Full Code Here

    public ModelAndView submitOrderDelivery(final HttpServletRequest request, final HttpServletResponse response, @Valid CartForm cartForm,
                                            BindingResult result, ModelMap modelMap) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
       
        // SANITY CHECK
        final Cart currentCart = requestData.getCart();
        if (currentCart.getTotalCartItems() == 0) {
            return new ModelAndView(new RedirectView(urlService.generateUrl(FoUrls.CART_DETAILS, requestUtil.getRequestData(request))));
        }

        if (result.hasErrors()) {
            return displayOrderDelivery(request, response);
        }

        if (currentCart.getDeliveryMethods() == null) {
            addErrorMessage(request, "DELIVERY");
            return displayOrderDelivery(request, response);
        }

        webManagementService.updateCart(requestData, Long.parseLong(cartForm.getBillingAddressId()), Long.parseLong(cartForm.getShippingAddressId()));
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.Cart

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.