Class CartPageController


  • @Controller
    @RequestMapping("/cart")
    public class CartPageController
    extends AbstractCartPageController
    Controller for cart page
    • Field Detail

      • SHOW_CHECKOUT_STRATEGY_OPTIONS

        public static final java.lang.String SHOW_CHECKOUT_STRATEGY_OPTIONS
        See Also:
        Constant Field Values
      • SUCCESSFUL_MODIFICATION_CODE

        public static final java.lang.String SUCCESSFUL_MODIFICATION_CODE
        See Also:
        Constant Field Values
      • SITE_QUOTES_ENABLED

        public static final java.lang.String SITE_QUOTES_ENABLED
        See Also:
        Constant Field Values
    • Constructor Detail

      • CartPageController

        public CartPageController()
    • Method Detail

      • isCheckoutStrategyVisible

        @ModelAttribute("showCheckoutStrategies")
        public boolean isCheckoutStrategyVisible()
      • getQuoteUrl

        protected java.util.Optional<java.lang.String> getQuoteUrl()
      • cartCheck

        @RequestMapping(value="/checkout",
                        method=GET)
        public java.lang.String cartCheck​(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
                                   throws CommerceCartModificationException
        Handle the '/cart/checkout' request url. This method checks to see if the cart is valid before allowing the checkout to begin. Note that this method does not require the user to be authenticated and therefore allows us to validate that the cart is valid without first forcing the user to login. The cart will be checked again once the user has logged in.
        Returns:
        The page to redirect to
        Throws:
        CommerceCartModificationException
      • getProductVariantMatrix

        @RequestMapping(value="/getProductVariantMatrix",
                        method=GET)
        public java.lang.String getProductVariantMatrix​(@RequestParam("productCode")
                                                        java.lang.String productCode,
                                                        @RequestParam(value="readOnly",required=false,defaultValue="false")
                                                        java.lang.String readOnly,
                                                        org.springframework.ui.Model model)
      • initCheck

        @RequestMapping(value="/checkout/select-flow",
                        method=GET)
        public java.lang.String initCheck​(org.springframework.ui.Model model,
                                          org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel,
                                          @RequestParam(value="flow",required=false)
                                          java.lang.String flow,
                                          @RequestParam(value="pci",required=false)
                                          java.lang.String pci)
                                   throws CommerceCartModificationException
        Throws:
        CommerceCartModificationException
      • removeGroup

        @RequestMapping(value="/entrygroups/{groupNumber}",
                        method=POST)
        public java.lang.String removeGroup​(@PathVariable("groupNumber")
                                            java.lang.Integer groupNumber,
                                            org.springframework.ui.Model model,
                                            org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
      • updateCartQuantities

        @RequestMapping(value="/update",
                        method=POST)
        public java.lang.String updateCartQuantities​(@RequestParam("entryNumber")
                                                     long entryNumber,
                                                     org.springframework.ui.Model model,
                                                     @Valid
                                                     @Valid UpdateQuantityForm form,
                                                     org.springframework.validation.BindingResult bindingResult,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
                                              throws CMSItemNotFoundException
        Throws:
        CMSItemNotFoundException
      • addFlashMessage

        protected void addFlashMessage​(UpdateQuantityForm form,
                                       javax.servlet.http.HttpServletRequest request,
                                       org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel,
                                       CartModificationData cartModification)
      • updateCartQuantitiesMultiD

        @ResponseBody
        @RequestMapping(value="/updateMultiD",
                        method=POST)
        public CartData updateCartQuantitiesMultiD​(@RequestParam("entryNumber")
                                                   java.lang.Integer entryNumber,
                                                   @RequestParam("productCode")
                                                   java.lang.String productCode,
                                                   org.springframework.ui.Model model,
                                                   @Valid
                                                   @Valid UpdateQuantityForm form,
                                                   org.springframework.validation.BindingResult bindingResult)
      • getOrderEntryData

        protected OrderEntryData getOrderEntryData​(long quantity,
                                                   java.lang.String productCode,
                                                   java.lang.Integer entryNumber)
      • saveCart

        @RequestMapping(value="/save",
                        method=POST)
        public java.lang.String saveCart​(SaveCartForm form,
                                         org.springframework.validation.BindingResult bindingResult,
                                         org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
                                  throws CommerceSaveCartException
        Throws:
        CommerceSaveCartException
      • exportCsvFile

        @RequestMapping(value="/export",
                        method=GET,
                        produces="text/csv")
        public java.lang.String exportCsvFile​(javax.servlet.http.HttpServletResponse response,
                                              org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • applyVoucherAction

        @RequestMapping(value="/voucher/apply",
                        method=POST)
        public java.lang.String applyVoucherAction​(@Valid
                                                   @Valid VoucherForm form,
                                                   org.springframework.validation.BindingResult bindingResult,
                                                   org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
      • removeVoucher

        @RequestMapping(value="/voucher/remove",
                        method=POST)
        public java.lang.String removeVoucher​(@Valid
                                              @Valid VoucherForm form,
                                              org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
      • setBaseSiteService

        public void setBaseSiteService​(BaseSiteService baseSiteService)
      • executeCartEntryAction

        @RequestMapping(value="/entry/execute/{actionCode:.*}",
                        method=POST)
        public java.lang.String executeCartEntryAction​(@PathVariable(value="actionCode",required=true)
                                                       java.lang.String actionCode,
                                                       org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel,
                                                       @RequestParam("entryNumbers")
                                                       java.lang.Long[] entryNumbers)
      • getCartPageRedirectUrl

        protected java.lang.String getCartPageRedirectUrl()