Search in sources :

Example 1 with ShippingInfoForm

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);
}
Also used : ShippingInfoForm(org.broadleafcommerce.core.web.checkout.model.ShippingInfoForm)

Example 2 with ShippingInfoForm

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");
}
Also used : ShippingInfoForm(org.broadleafcommerce.core.web.checkout.model.ShippingInfoForm)

Example 3 with ShippingInfoForm

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;
}
Also used : Order(org.broadleafcommerce.core.order.domain.Order) OrderInfoForm(org.broadleafcommerce.core.web.checkout.model.OrderInfoForm) ShippingInfoForm(org.broadleafcommerce.core.web.checkout.model.ShippingInfoForm) HashMap(java.util.HashMap) BillingInfoForm(org.broadleafcommerce.core.web.checkout.model.BillingInfoForm) NullOrderImpl(org.broadleafcommerce.core.order.domain.NullOrderImpl)

Aggregations

ShippingInfoForm (org.broadleafcommerce.core.web.checkout.model.ShippingInfoForm)3 HashMap (java.util.HashMap)1 NullOrderImpl (org.broadleafcommerce.core.order.domain.NullOrderImpl)1 Order (org.broadleafcommerce.core.order.domain.Order)1 BillingInfoForm (org.broadleafcommerce.core.web.checkout.model.BillingInfoForm)1 OrderInfoForm (org.broadleafcommerce.core.web.checkout.model.OrderInfoForm)1