use of org.broadleafcommerce.core.web.checkout.model.ShippingInfoForm in project BroadleafCommerce by BroadleafCommerce.
the class MultishipAddAddressFormValidator method validate.
public void validate(Object obj, Errors errors) {
ShippingInfoForm shippingInfoForm = (ShippingInfoForm) obj;
super.validate(BroadleafFormType.SHIPPING_FORM, shippingInfoForm.getAddress(), errors);
}
use of org.broadleafcommerce.core.web.checkout.model.ShippingInfoForm in project BroadleafCommerce by BroadleafCommerce.
the class ShippingInfoFormValidator method validate.
public void validate(Object obj, Errors errors) {
ShippingInfoForm shippingInfoForm = (ShippingInfoForm) obj;
super.validate(BroadleafFormType.SHIPPING_FORM, shippingInfoForm.getAddress(), errors);
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "fulfillmentOptionId", "fulfillmentOptionId.required");
}
use of org.broadleafcommerce.core.web.checkout.model.ShippingInfoForm in project BroadleafCommerce by BroadleafCommerce.
the class OnePageCheckoutProcessor method populateModelVariables.
@Override
public Map<String, Object> populateModelVariables(String tagName, Map<String, String> tagAttributes, BroadleafTemplateContext context) {
// Pre-populate the command objects
OrderInfoForm orderInfoForm = context.parseExpression(tagAttributes.get("orderInfoForm"));
ShippingInfoForm shippingInfoForm = context.parseExpression(tagAttributes.get("shippingInfoForm"));
BillingInfoForm billingInfoForm = context.parseExpression(tagAttributes.get("billingInfoForm"));
String orderInfoHelpMessage = context.parseExpression(tagAttributes.get("orderInfoHelpMessage"));
String billingInfoHelpMessage = context.parseExpression(tagAttributes.get("billingInfoHelpMessage"));
String shippingInfoHelpMessage = context.parseExpression(tagAttributes.get("shippingInfoHelpMessage"));
prepopulateCheckoutForms(CartState.getCart(), orderInfoForm, shippingInfoForm, billingInfoForm);
// Add PaymentRequestDTO to the model in the case of errors or other cases
Map<String, Object> newModelVars = new HashMap<>();
Order cart = CartState.getCart();
if (cart != null && !(cart instanceof NullOrderImpl)) {
newModelVars.put("paymentRequestDTO", orderToPaymentRequestDTOService.translateOrder(cart));
}
// Initialize Fulfillment Group Vars
int numShippableFulfillmentGroups = calculateNumShippableFulfillmentGroups();
newModelVars.put("numShippableFulfillmentGroups", numShippableFulfillmentGroups);
populateFulfillmentOptionsAndEstimationOnModel(newModelVars);
// Initialize View States
newModelVars.put("orderInfoHelpMessage", orderInfoHelpMessage);
newModelVars.put("billingInfoHelpMessage", billingInfoHelpMessage);
newModelVars.put("shippingInfoHelpMessage", shippingInfoHelpMessage);
populateSectionViewStates(newModelVars);
// Helpful lists to populate dropdowns on a checkout page
newModelVars.put("states", stateService.findStates());
newModelVars.put("countries", countryService.findCountries());
newModelVars.put("expirationMonths", populateExpirationMonths());
newModelVars.put("expirationYears", populateExpirationYears());
// Populate any Payment Processing Errors
populateProcessingError(newModelVars);
return newModelVars;
}
Aggregations