Package org.hoteia.qalingo.core.domain

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


    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse updateProductSkuQuantityToCart(UpdateItemQuantityCartPojoRequest updateItemQuantityCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        if(StringUtils.isNotEmpty(updateItemQuantityCartPojoRequest.getCartId())){
            Cart cart = cartService.getCartById(updateItemQuantityCartPojoRequest.getCartId());
            String productSkuCode = updateItemQuantityCartPojoRequest.getProductSkuCode();
            int quantity = updateItemQuantityCartPojoRequest.getQuantity();
            checkoutPojoService.updateCartItem(cart, productSkuCode, quantity);
                   
        } else {
View Full Code Here


    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse deleteProductSkuQuantityToCart(UpdateItemQuantityCartPojoRequest updateItemQuantityCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        if(StringUtils.isNotEmpty(updateItemQuantityCartPojoRequest.getCartId())){
            Cart cart = cartService.getCartById(updateItemQuantityCartPojoRequest.getCartId());
            String productSkuCode = updateItemQuantityCartPojoRequest.getProductSkuCode();
            checkoutPojoService.deleteCartItem(cart, productSkuCode);
                   
        } else {
            // TODO SEND ERREUR
View Full Code Here

    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse applyPromoCode(PromoCodeCartPojoRequest promoCodeCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        if (StringUtils.isNotEmpty(promoCodeCartPojoRequest.getCartId())) {
            Cart cart = cartService.getCartById(promoCodeCartPojoRequest.getCartId());
            String promoCode = promoCodeCartPojoRequest.getPromoCode();

            // TODO MANAGE promoCode

        } else {
View Full Code Here

           
            if(StringUtils.isNotEmpty(currentCustomerName)){
                Customer customer = customerService.getCustomerByLoginOrEmail(currentCustomerName);

                if(StringUtils.isNotEmpty(addressCartPojoRequest.getCartId())){
                    Cart cart = cartService.getCartById(addressCartPojoRequest.getCartId());
                    String customerAddressId = addressCartPojoRequest.getCustomerAddressId();
                    checkoutPojoService.setShippingAddress(cart, customer, customerAddressId);
                   
                } else {
                    // TODO SEND ERREUR
View Full Code Here

           
            if(StringUtils.isNotEmpty(currentCustomerName)){
                Customer customer = customerService.getCustomerByLoginOrEmail(currentCustomerName);

                if(StringUtils.isNotEmpty(addressCartPojoRequest.getCartId())){
                    Cart cart = cartService.getCartById(addressCartPojoRequest.getCartId());
                    String customerAddressId = addressCartPojoRequest.getCustomerAddressId();
                    checkoutPojoService.setBillingAddress(cart, customer, customerAddressId);
                   
                } else {
                    // TODO SEND ERREUR
View Full Code Here

    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse setDeliveryMethod(DeliveryMethodCartPojoRequest deliveryMethodCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        if(StringUtils.isNotEmpty(deliveryMethodCartPojoRequest.getCartId())){
            Cart cart = cartService.getCartById(deliveryMethodCartPojoRequest.getCartId());
            String deliveryMethodCode = deliveryMethodCartPojoRequest.getDeliveryMethodCode();
            checkoutPojoService.setDeliveryMethod(cart, deliveryMethodCode);
                   
        } else {
            // TODO SEND ERREUR
View Full Code Here

        final Locale locale = requestData.getLocale();
        final HeaderCartViewBean headerCartViewBean = new HeaderCartViewBean();

        // NO CACHE FOR THIS PART

        final Cart currentCart = requestData.getCart();
        headerCartViewBean.setCheckoutShoppingCartUrl(urlService.generateUrl(FoUrls.CART_DETAILS, requestData));
        if(currentCart != null && currentCart.getCartItems() != null){
            headerCartViewBean.setCartTotalItems(currentCart.getCartItems().size());
            if (currentCart.getCartItems().size() == 1) {
                headerCartViewBean.setCheckoutShoppingCartHeaderLabel(getSpecificMessage(ScopeWebMessage.COMMON, "cart_total_summary_label_one_item", locale));
            } else if (currentCart.getCartItems().size() > 1) {
                Object[] cartTotalSummaryLabelParams = { currentCart.getCartItems().size() };
                headerCartViewBean.setCheckoutShoppingCartHeaderLabel(getSpecificMessage(ScopeWebMessage.COMMON, "cart_total_summary_label_many_items", cartTotalSummaryLabelParams, locale));
            } else {
                headerCartViewBean.setCheckoutShoppingCartHeaderLabel(getSpecificMessage(ScopeWebMessage.COMMON, "cart_total_summary_label_no_item", locale));
            }
           
View Full Code Here

        }
        return saveOrUpdateCart(cart);
    }
   
    public Cart newCustomerCart(final MarketArea marketArea, Customer customer) {
        Cart cart = new Cart();
        cart.setMarketAreaId(marketArea.getId());
        cart.setCustomerId(customer.getId());
        saveOrUpdateCart(cart);
        return cart;
    }
View Full Code Here

        saveOrUpdateCart(cart);
        return cart;
    }
   
    public Cart newGuestCart(final MarketArea marketArea) {
        Cart cart = new Cart();
        cart.setMarketAreaId(marketArea.getId());
        saveOrUpdateCart(cart);
        return cart;
    }
View Full Code Here

    /**
     *
     */
    protected EngineEcoSession initCart(final HttpServletRequest request) throws Exception {
        final EngineEcoSession engineEcoSession = getCurrentEcoSession(request);
        Cart cart = engineEcoSession.getCart();
        if (cart == null) {
            // Init a new empty Cart with a default configuration
            engineEcoSession.addNewCart();
        }
        updateCurrentEcoSession(request, engineEcoSession);
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.