Class BroadleafShippingInfoController
java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.core.web.controller.checkout.AbstractCheckoutController
org.broadleafcommerce.core.web.controller.checkout.BroadleafShippingInfoController
In charge of performing the various checkout operations
- Author:
- Andre Azzolini (apazzolini), Elbert Bautista (elbertbautista), Joshua Skorton (jskorton)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Stringprotected static Stringprotected static Stringprotected static StringFields inherited from class org.broadleafcommerce.core.web.controller.checkout.AbstractCheckoutController
ACTIVE_STAGE, addressService, baseConfirmationView, billingInfoFormValidator, cartPageRedirect, cartStateService, checkoutControllerExtensionManager, checkoutPageRedirect, checkoutService, checkoutStagesPartial, checkoutView, countryService, countrySubdivisionService, customerAddressService, customerPaymentService, customerService, dtoTranslationService, fulfillmentGroupService, fulfillmentOptionService, giftCardInfoFormValidator, initBinderService, isoService, multishipAddAddressFormValidator, orderInfoFormValidator, orderMultishipOptionService, orderPaymentService, orderService, paymentGatewayCheckoutService, paymentInfoFormValidator, phoneService, shippingInfoFormValidator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToSingleship(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) Converts the order to single ship by collapsing all of the shippable fulfillment groups into the default (first) shippable fulfillment group.protected voidcopyBillingAddressToShippingAddress(org.broadleafcommerce.core.order.domain.Order order, ShippingInfoForm shippingInfoForm) This method will copy the billing address of any CREDIT CARD order payment on the order to the shipping address on the ShippingInfoForm that is passed in.voidsaveMultiship(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, OrderMultishipOptionForm orderMultishipOptionForm, org.springframework.validation.BindingResult result) Processes the given options for multiship.saveMultishipAddAddress(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, ShippingInfoForm addressForm, org.springframework.validation.BindingResult result) Processes the requested add address from the multiship process.saveMultiShipInstruction(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, MultiShipInstructionForm instructionForm) saveSingleShip(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, ShippingInfoForm shippingForm, org.springframework.validation.BindingResult result) Processes the request to save a single shipping address.showMultiship(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) Renders the multiship page.showMultishipAddAddress(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) Renders the add address form during the multiship processMethods inherited from class org.broadleafcommerce.core.web.controller.checkout.AbstractCheckoutController
getBaseConfirmationView, getCartPageRedirect, getCheckoutPageRedirect, getCheckoutStagesPartial, getCheckoutView, getConfirmationView, initBinder, populateModelWithReferenceDataMethods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
-
Field Details
-
multishipView
-
multishipAddAddressView
-
multishipAddAddressSuccessView
-
multishipSuccessView
-
-
Constructor Details
-
BroadleafShippingInfoController
public BroadleafShippingInfoController()
-
-
Method Details
-
getMultishipView
-
getMultishipAddAddressView
-
getMultishipSuccessView
-
getMultishipAddAddressSuccessView
-
convertToSingleship
public String convertToSingleship(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) throws org.broadleafcommerce.core.pricing.service.exception.PricingException Converts the order to single ship by collapsing all of the shippable fulfillment groups into the default (first) shippable fulfillment group. Allows modules to add module specific shipping logic.- Parameters:
request-response-model-- Returns:
- a redirect to /checkout
- Throws:
org.broadleafcommerce.core.pricing.service.exception.PricingException
-
saveSingleShip
public String saveSingleShip(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, ShippingInfoForm shippingForm, org.springframework.validation.BindingResult result) throws org.broadleafcommerce.core.pricing.service.exception.PricingException, org.broadleafcommerce.common.exception.ServiceException Processes the request to save a single shipping address. Allows modules to add module specific shipping logic.Note: the default Broadleaf implementation creates an order with a single fulfillment group. In the case of shipping to multiple addresses, the multiship methods should be used.
- Parameters:
request-response-model-shippingForm-- Returns:
- the return path
- Throws:
org.broadleafcommerce.common.exception.ServiceExceptionorg.broadleafcommerce.core.pricing.service.exception.PricingException
-
copyBillingAddressToShippingAddress
protected void copyBillingAddressToShippingAddress(org.broadleafcommerce.core.order.domain.Order order, ShippingInfoForm shippingInfoForm) This method will copy the billing address of any CREDIT CARD order payment on the order to the shipping address on the ShippingInfoForm that is passed in. -
showMultiship
public String showMultiship(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) Renders the multiship page. This page is used by the user when shipping items to different locations (or with different FulfillmentOptions) is desired.Note that the default Broadleaf implementation will require the user to input an Address and FulfillmentOption for each quantity of each DiscreteOrderItem.
- Parameters:
request-response-model-- Returns:
- the return path
-
saveMultiship
public String saveMultiship(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, OrderMultishipOptionForm orderMultishipOptionForm, org.springframework.validation.BindingResult result) throws org.broadleafcommerce.core.pricing.service.exception.PricingException, org.broadleafcommerce.common.exception.ServiceException Processes the given options for multiship. Validates that all options are selected before performing any actions. Allows modules to add module specific shipping logic.- Parameters:
request-response-model-orderMultishipOptionForm-- Returns:
- a redirect to the checkout page
- Throws:
org.broadleafcommerce.core.pricing.service.exception.PricingExceptionorg.broadleafcommerce.common.exception.ServiceException- See Also:
-
showMultishipAddAddress
public String showMultishipAddAddress(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) Renders the add address form during the multiship process- Parameters:
request-response-model-- Returns:
- the return path
-
saveMultishipAddAddress
public String saveMultishipAddAddress(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, ShippingInfoForm addressForm, org.springframework.validation.BindingResult result) throws org.broadleafcommerce.common.exception.ServiceException Processes the requested add address from the multiship process. This method will create a CustomerAddress based on the requested Address and associate it with the current Customer in session.- Parameters:
request-response-model-addressForm-- Returns:
- the return path to the multiship page
- Throws:
org.broadleafcommerce.common.exception.ServiceException
-
saveMultiShipInstruction
public String saveMultiShipInstruction(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, MultiShipInstructionForm instructionForm) throws org.broadleafcommerce.common.exception.ServiceException, org.broadleafcommerce.core.pricing.service.exception.PricingException - Throws:
org.broadleafcommerce.common.exception.ServiceExceptionorg.broadleafcommerce.core.pricing.service.exception.PricingException
-
removeUnusedPhones
-