Package org.broadleafcommerce.profile.core.domain

Examples of org.broadleafcommerce.profile.core.domain.Address


    @Test(groups = "createFulfillmentGroupLegacy", dataProvider = "basicFulfillmentGroupLegacy", dataProviderClass = FulfillmentGroupDataProvider.class)
    @Transactional
    @Rollback(false)
    public void createFulfillmentGroup(FulfillmentGroup fulfillmentGroup) {
        Customer customer = createCustomerWithBasicOrderAndAddresses();
        Address address = (customerAddressDao.readActiveCustomerAddressesByCustomerId(customer.getId())).get(0).getAddress();
        Order salesOrder = (orderDao.readOrdersForCustomer(customer.getId())).get(0);

        FulfillmentGroup newFG = fulfillmentGroupDao.create();
        newFG.setAddress(address);
        newFG.setRetailShippingPrice(fulfillmentGroup.getRetailShippingPrice());
View Full Code Here


        customerService.saveCustomer(order.getCustomer());

        createCountry();
        createState();

        Address address = new AddressImpl();
        address.setAddressLine1("123 Test Rd");
        address.setCity("Dallas");
        address.setFirstName("Jeff");
        address.setLastName("Fischer");
        address.setPostalCode("75240");
        address.setPrimaryPhone("972-978-9067");
        address.setState(stateService.findStateByAbbreviation("KY"));
        address.setCountry(countryService.findCountryByAbbreviation("US"));

        FulfillmentGroup group = new FulfillmentGroupImpl();
        group.setAddress(address);
        group.setIsShippingPriceTaxable(true);
        List<FulfillmentGroup> groups = new ArrayList<FulfillmentGroup>();
View Full Code Here

        customerService.saveCustomer(order.getCustomer());

        createCountry();
        createState();

        Address address = new AddressImpl();
        address.setAddressLine1("123 Test Rd");
        address.setCity("Dallas");
        address.setFirstName("Jeff");
        address.setLastName("Fischer");
        address.setPostalCode("75240");
        address.setPrimaryPhone("972-978-9067");
        address.setState(stateService.findStateByAbbreviation("KY"));
        address.setCountry(countryService.findCountryByAbbreviation("US"));

        FulfillmentGroup group = new FulfillmentGroupImpl();
        group.setAddress(address);
        group.setIsShippingPriceTaxable(true);
        List<FulfillmentGroup> groups = new ArrayList<FulfillmentGroup>();
View Full Code Here

        order = orderService.save(order, false);

        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);
View Full Code Here

     */
    protected void copyBillingAddressToShippingAddress(Order order, ShippingInfoForm shippingInfoForm) {
        if (order.getPayments() != null) {
            for (OrderPayment payment : order.getPayments()) {
                if (payment.isActive() && PaymentType.CREDIT_CARD.equals(payment.getType())) {
                    Address billing = payment.getBillingAddress();
                    if (billing != null) {
                        Address shipping = addressService.create();
                        shipping.setFirstName(billing.getFirstName());
                        shipping.setLastName(billing.getLastName());
                        shipping.setAddressLine1(billing.getAddressLine1());
                        shipping.setAddressLine2(billing.getAddressLine2());
                        shipping.setCity(billing.getCity());
                        shipping.setState(billing.getState());
                        shipping.setPostalCode(billing.getPostalCode());
                        shipping.setCountry(billing.getCountry());
                        shipping.setPrimaryPhone(billing.getPrimaryPhone());
                        shipping.setEmailAddress(billing.getEmailAddress());
                        shippingInfoForm.setAddress(shipping);
                    }
                }
            }

View Full Code Here

     * This method will copy the shipping address of the first fulfillment group on the order
     * to the billing address on the BillingInfoForm that is passed in.
     */
    protected void copyShippingAddressToBillingAddress(Order order, BillingInfoForm billingInfoForm) {
        if (order.getFulfillmentGroups().get(0) != null) {
            Address shipping = order.getFulfillmentGroups().get(0).getAddress();
            if (shipping != null) {
                Address billing = addressService.create();
                billing.setFirstName(shipping.getFirstName());
                billing.setLastName(shipping.getLastName());
                billing.setAddressLine1(shipping.getAddressLine1());
                billing.setAddressLine2(shipping.getAddressLine2());
                billing.setCity(shipping.getCity());
                billing.setState(shipping.getState());
                billing.setPostalCode(shipping.getPostalCode());
                billing.setCountry(shipping.getCountry());
                billing.setPrimaryPhone(shipping.getPrimaryPhone());
                billing.setEmailAddress(shipping.getEmailAddress());
                billingInfoForm.setAddress(billing);
            }
        }
    }
View Full Code Here

    public String addCustomerAddress(HttpServletRequest request, Model model, CustomerAddressForm form, BindingResult result, RedirectAttributes redirectAttributes) throws ServiceException {
        customerAddressValidator.validate(form, result);
        if (result.hasErrors()) {
            return getCustomerAddressesView();
        }
        Address address = addressService.saveAddress(form.getAddress());
        CustomerAddress customerAddress = customerAddressService.create();
        customerAddress.setAddress(address);
        customerAddress.setAddressName(form.getAddressName());
        customerAddress.setCustomer(CustomerState.getCustomer());
        customerAddress = customerAddressService.saveCustomerAddress(customerAddress);
View Full Code Here

    @Rollback(false)
    @Transactional
    public void addFulfillmentGroupToOrderFirst(FulfillmentGroup fulfillmentGroup) throws PricingException {
        String userName = "customer1";
        Customer customer = customerService.readCustomerByUsername(userName);
        Address address = customerAddressService.readActiveCustomerAddressesByCustomerId(customer.getId()).get(0).getAddress();
        Order order = cartService.findOrderById(orderId);

        fulfillmentGroup.setOrder(order);
        fulfillmentGroup.setAddress(address);
        FulfillmentGroup fg = cartService.addFulfillmentGroupToOrder(order, fulfillmentGroup);
View Full Code Here

    @Test(groups= {"addItemToFulfillmentGroupSecondLegacy"}, dependsOnGroups = { "addFulfillmentGroupToOrderFirstLegacy" })
    @Transactional
    public void addItemToFulfillmentgroupSecond() {
        String userName = "customer1";
        Customer customer = customerService.readCustomerByUsername(userName);
        Address address = customerAddressService.readActiveCustomerAddressesByCustomerId(customer.getId()).get(0).getAddress();
        Order order = cartService.findOrderById(orderId);
        List<OrderItem> orderItems = order.getOrderItems();
        assert(orderItems.size() > 0);
        FulfillmentGroup newFg = new FulfillmentGroupImpl();
        newFg.setAddress(address);
View Full Code Here

        state.setName("Texas");
        state.setCountry(country);

        state = stateService.save(state);
       
        Address address = new AddressImpl();
        address.setAddressLine1("123 Test Rd");
        address.setCity("Dallas");
        address.setFirstName("Jeff");
        address.setLastName("Fischer");
        address.setPostalCode("75240");
        address.setPrimaryPhone("972-978-9067");
        address.setState(state);
        address.setCountry(country);
       
        FulfillmentGroup group = new FulfillmentGroupImpl();
        group.setAddress(address);
        List<FulfillmentGroup> groups = new ArrayList<FulfillmentGroup>();
        group.setMethod("standard");
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.profile.core.domain.Address

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.