Package org.hoteia.qalingo.core.pojo.cart

Examples of org.hoteia.qalingo.core.pojo.cart.FoMessagePojo


        addToWishlist.setWishListDetailsUrl(urlService.generateUrl(FoUrls.PERSONAL_WISHLIST, requestData));
        try {
            webManagementService.addProductSkuToWishlist(requestData, catalogCategoryCode, productSkuCode);
           
            FoMessagePojo successMessage = new FoMessagePojo();
            successMessage.setId("success-add-to-wishlist-product-sku");
            Object[] messageParams = { productSku.getI18nName(localization.getCode()) };
            successMessage.setMessage(getSpecificMessage(ScopeWebMessage.WISHLIST, "add_to_wishlist_success_message", messageParams, locale));
            addToWishlist.getSuccessMessages().add(successMessage);
            return addToWishlist;
           
        } catch (ProductAlreadyExistInWishlistException e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            Object[] messageParams = { productSku.getI18nName(localization.getCode()) };
            errorMessage.setMessage(getSpecificMessage(ScopeWebMessage.ERROR, ProductAlreadyExistInWishlistException.MESSAGE_KEY, messageParams, locale));
            addToWishlist.getErrorMessages().add(errorMessage);
            addToWishlist.setStatuts(false);
            return addToWishlist;
           
        } catch (Exception e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            errorMessage.setId("error-add-to-wishlist-product-sku");
            Object[] messageParams = { productSku.getI18nName(localization.getCode()) };
            errorMessage.setMessage(getSpecificMessage(ScopeWebMessage.WISHLIST, "add_to_wishlist_error_message", messageParams, locale));
            addToWishlist.getErrorMessages().add(errorMessage);
            addToWishlist.setStatuts(false);
            return addToWishlist;
        }
    }
View Full Code Here


                addToCart.setCheckoutShoppingCartHeaderLabel(getSpecificMessage(ScopeWebMessage.COMMON, "cart_total_summary_label_no_item", locale));
            }
           
            addToCart.setCheckoutShoppingCartUrl(urlService.generateUrl(FoUrls.CART_DETAILS, requestData));
           
            FoMessagePojo successMessage = new FoMessagePojo();
            successMessage.setId("success-add-to-cart-product-sku");
            Object[] messageParams = { productSku.getI18nName(localization.getCode()) };
            successMessage.setMessage(getSpecificMessage(ScopeWebMessage.CHECKOUT_SHOPPING_CART, "add_to_cart_success_message", messageParams, locale));
            addToCart.getSuccessMessages().add(successMessage);
            return addToCart;
           
        } catch (Exception e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            errorMessage.setId("error-add-to-cart-product-sku");
            Object[] messageParams = { productSku.getI18nName(localization.getCode()) };
            errorMessage.setMessage(getSpecificMessage(ScopeWebMessage.CHECKOUT_SHOPPING_CART, "add_to_cart_error_message", messageParams, locale));
            addToCart.getErrorMessages().add(errorMessage);
            addToCart.setStatuts(false);
            return addToCart;
        }
    }
View Full Code Here

        try {
            int quantityValue = Integer.parseInt(quantity);
            webManagementService.updateCart(requestData, productSkuCode, quantityValue);
        } catch (Exception e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            errorMessage.setId("error-update-quantity");
            errorMessage.setMessage(e.getMessage());
            checkout.getErrorMessages().add(errorMessage);
            checkout.setStatuts(false);
            return checkout;
        }
        injectCart(requestData, checkout);
View Full Code Here

            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);
            }
           
        } catch (Exception e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            errorMessage.setId("error-delete-item");
            errorMessage.setMessage(e.getMessage());
            checkout.getErrorMessages().add(errorMessage);
            checkout.setStatuts(false);
            return checkout;
        }
        injectCart(requestData, checkout);
View Full Code Here

        final FoCheckoutPojo checkout = new FoCheckoutPojo();
        try {
            webManagementService.setShippingAddress(requestData, customerShippingAddressGuid);
        } catch (Exception e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            errorMessage.setId("error-set-shipping-address");
            errorMessage.setMessage(e.getMessage());
            checkout.getErrorMessages().add(errorMessage);
            checkout.setStatuts(false);
            return checkout;
        }
        injectCart(requestData, checkout);
View Full Code Here

        final FoCheckoutPojo checkout = new FoCheckoutPojo();
        try {
            webManagementService.setBillingAddress(requestData, customerBillingAddressGuid);
        } catch (Exception e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            errorMessage.setId("error-set-billing-address");
            errorMessage.setMessage(e.getMessage());
            checkout.getErrorMessages().add(errorMessage);
            checkout.setStatuts(false);
            return checkout;
        }
        injectCart(requestData, checkout);
View Full Code Here

        try {
            webManagementService.deleteCartItem(requestData, deliveryMethodCode);
           
        } catch (Exception e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            errorMessage.setId("error-set-delivery-method");
            errorMessage.setMessage(e.getMessage());
            checkout.getErrorMessages().add(errorMessage);
            checkout.setStatuts(false);
            return checkout;
        }
        injectCart(requestData, checkout);
View Full Code Here

            deliveryMethodInformation.setAvailableDeliveryMethods(availableDeliveryMethods);
            checkout.getDeliveryMethodInformations().add(deliveryMethodInformation);

        } catch (Exception e) {
            logger.error("", e);
            FoMessagePojo errorMessage = new FoMessagePojo();
            errorMessage.setId("error-cart");
            errorMessage.setMessage(e.getMessage());
            checkout.getErrorMessages().add(errorMessage);
            checkout.setStatuts(false);
        }
    }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.pojo.cart.FoMessagePojo

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.