Package org.broadleafcommerce.core.order.domain

Examples of org.broadleafcommerce.core.order.domain.OrderMultishipOption


            currentOptions.put(option.getId(), option);
        }
       
        List<OrderMultishipOption> orderMultishipOptions = new ArrayList<OrderMultishipOption>();
        for (OrderMultishipOptionDTO dto: optionDTOs) {
            OrderMultishipOption option = currentOptions.get(dto.getId());
            if (option == null) {
                option = orderMultishipOptionDao.create();
            }
           
            option.setOrder(order);
            option.setOrderItem(orderItemService.readOrderItemById(dto.getOrderItemId()));
           
            if (dto.getAddressId() != null) {
                option.setAddress(addressService.readAddressById(dto.getAddressId()));
            } else {
                option.setAddress(null);
            }
           
            if (dto.getFulfillmentOptionId() != null) {
                option.setFulfillmentOption(fulfillmentOptionService.readFulfillmentOptionById(dto.getFulfillmentOptionId()));
            } else {
                option.setFulfillmentOption(null);
            }
           
            orderMultishipOptions.add(option);
        }
       
View Full Code Here


   
    @Override
    public List<OrderMultishipOption> getOrderMultishipOptionsFromDTOs(Order order, List<OrderMultishipOptionDTO> optionDtos) {
        List<OrderMultishipOption> orderMultishipOptions = new ArrayList<OrderMultishipOption>();
        for (OrderMultishipOptionDTO optionDto : optionDtos) {
            OrderMultishipOption option = new OrderMultishipOptionImpl();
            if (optionDto.getAddressId() != null) {
                option.setAddress(addressService.readAddressById(optionDto.getAddressId()));
            }  
            if (optionDto.getFulfillmentOptionId() != null) {
                option.setFulfillmentOption(fulfillmentOptionService.readFulfillmentOptionById(optionDto.getFulfillmentOptionId()));
            }
            option.setId(optionDto.getId());
            option.setOrder(order);
            option.setOrderItem(orderItemService.readOrderItemById(optionDto.getOrderItemId()));
            orderMultishipOptions.add(option);
        }
        return orderMultishipOptions;
    }
View Full Code Here

        List<OrderMultishipOption> orderMultishipOptions = new ArrayList<OrderMultishipOption>();
        if (!fulfillmentGroupService.isShippable(item.getSku().getFulfillmentType())) {
            return orderMultishipOptions;
        }
        for (int i = 0; i < quantity; i++) {
            OrderMultishipOption orderMultishipOption = new OrderMultishipOptionImpl();
            orderMultishipOption.setOrder(order);
            orderMultishipOption.setOrderItem(item);
            orderMultishipOptions.add(orderMultishipOption);
        }
        return orderMultishipOptions;
    }
View Full Code Here

                PromotableOrder order = dataProvider.createBasicPromotableOrder();
                for (FulfillmentGroup fg : order.getOrder().getFulfillmentGroups()) {
                    Address address = fg.getAddress();
                    for (FulfillmentGroupItem fgItem : fg.getFulfillmentGroupItems()) {
                        for (int j=0;j<fgItem.getQuantity();j++) {
                            OrderMultishipOption option = new OrderMultishipOptionImpl();
                            option.setOrder(order.getOrder());
                            option.setAddress(address);
                            option.setOrderItem(fgItem.getOrderItem());
                            options.add(option);
                        }
                    }
                }
View Full Code Here

        Set<OrderMultishipOption> options = new HashSet<OrderMultishipOption>();
        for (FulfillmentGroup fg : order.getFulfillmentGroups()) {
            Address address = fg.getAddress();
            for (FulfillmentGroupItem fgItem : fg.getFulfillmentGroupItems()) {
                for (int j=0;j<fgItem.getQuantity();j++) {
                    OrderMultishipOption option = new OrderMultishipOptionImpl();
                    option.setOrder(order);
                    option.setAddress(address);
                    option.setOrderItem(fgItem.getOrderItem());
                    option.setFulfillmentOption(fg.getFulfillmentOption());
                    options.add(option);
                }
            }
        }
        for (OrderMultishipOption option : options) {
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.core.order.domain.OrderMultishipOption

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.