use of org.broadleafcommerce.profile.core.domain.Address in project BroadleafCommerce by BroadleafCommerce.
the class CheckoutFormServiceImpl method prePopulateBillingInfoForm.
@Override
public BillingInfoForm prePopulateBillingInfoForm(BillingInfoForm billingInfoForm, ShippingInfoForm shippingInfoForm, Order cart) {
Address orderPaymentBillingAddress = getAddressFromCCOrderPayment(cart);
if (orderPaymentBillingAddress != null) {
billingInfoForm.setAddress(orderPaymentBillingAddress);
}
boolean shippingAddressUsedForBilling = addressesContentsAreEqual(shippingInfoForm.getAddress(), billingInfoForm.getAddress());
billingInfoForm.setUseShippingAddress(shippingAddressUsedForBilling);
return billingInfoForm;
}
use of org.broadleafcommerce.profile.core.domain.Address in project BroadleafCommerce by BroadleafCommerce.
the class BroadleafBillingInfoController method copyShippingAddressToBillingAddress.
/**
* 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.copyAddress(shipping);
billingInfoForm.setAddress(billing);
}
}
}
Aggregations