return customerAddressForm;
}
public CartForm buildCartForm(final RequestData requestData) throws Exception {
final CartForm cartForm = new CartForm();
Customer customer = requestData.getCustomer();
if(customer != null) {
Set<CustomerAddress> addresses = customer.getAddresses();
for (Iterator<CustomerAddress> iterator = addresses.iterator(); iterator.hasNext();) {
CustomerAddress customerAddress = (CustomerAddress) iterator.next();
if(customerAddress.isDefaultBilling()) {
cartForm.setBillingAddressId(customerAddress.getId().toString());
}
if(customerAddress.isDefaultShipping()) {
cartForm.setShippingAddressId(customerAddress.getId().toString());
}
}
}
return cartForm;
}