Package org.broadleafcommerce.core.order.domain

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


    public FulfillmentGroupWrapper addFulfillmentOptionToFulfillmentGroup(HttpServletRequest request,
            Long fulfillmentGroupId,
            Long fulfillmentOptionId,
            boolean priceOrder) {

        FulfillmentOption option = fulfillmentOptionService.readFulfillmentOptionById(fulfillmentOptionId);
        if (option == null) {
            throw BroadleafWebServicesException.build(Response.Status.NOT_FOUND.getStatusCode())
                    .addMessage(BroadleafWebServicesException.FULFILLMENT_OPTION_NOT_FOUND, fulfillmentOptionId);
        }


                    shippingForm.setAddress(defaultAddress.getAddress());
                    shippingForm.setAddressName(defaultAddress.getAddressName());
                }
            }

            FulfillmentOption fulfillmentOption = firstShippableFulfillmentGroup.getFulfillmentOption();
            if (fulfillmentOption != null) {
                shippingForm.setFulfillmentOption(fulfillmentOption);
                shippingForm.setFulfillmentOptionId(fulfillmentOption.getId());
            }
        }


        if (cart.getPayments() != null) {

            fulfillmentGroupRequest.setPhone(this.phone.unwrap(request, appContext));
        }

        if (this.fulfillmentOption != null && this.fulfillmentOption.getId() != null) {
            FulfillmentOptionService fulfillmentOptionService = (FulfillmentOptionService) appContext.getBean("blFulfillmentOptionService");
            FulfillmentOption option = fulfillmentOptionService.readFulfillmentOptionById(this.fulfillmentOption.getId());
            fulfillmentGroupRequest.setOption(option);
        }

        return fulfillmentGroupRequest;
    }

        FulfillmentGroup shippableFulfillmentGroup = fulfillmentGroupService.getFirstShippableFulfillmentGroup(cart);
        if (shippableFulfillmentGroup != null) {
            shippableFulfillmentGroup.setAddress(shippingForm.getAddress());
            shippableFulfillmentGroup.setPersonalMessage(shippingForm.getPersonalMessage());
            shippableFulfillmentGroup.setDeliveryInstruction(shippingForm.getDeliveryMessage());
            FulfillmentOption fulfillmentOption = fulfillmentOptionService.readFulfillmentOptionById(shippingForm.getFulfillmentOptionId());
            shippableFulfillmentGroup.setFulfillmentOption(fulfillmentOption);

            cart = orderService.save(cart, true);
        }

TOP

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

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.