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

  • Constructor Details

    • CartPageController

      public CartPageController()
  • Method Details

    • isCheckoutStrategyVisible

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

      @RequestMapping(method=GET) public String showCart(org.springframework.ui.Model model) throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • prepareCartUrl

      protected String prepareCartUrl(org.springframework.ui.Model model) throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • getQuoteUrl

      protected Optional<String> getQuoteUrl()
    • cartCheck

      @RequestMapping(value="/checkout", method=GET) public 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 String getProductVariantMatrix(@RequestParam("productCode") String productCode, @RequestParam(value="readOnly",required=false,defaultValue="false") String readOnly, org.springframework.ui.Model model)
    • initCheck

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

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

      @RequestMapping(value="/update", method=POST) public 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
    • prepareDataForPage

      protected void prepareDataForPage(org.springframework.ui.Model model) throws CMSItemNotFoundException
      Overrides:
      prepareDataForPage in class AbstractCartPageController
      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") Integer entryNumber, @RequestParam("productCode") String productCode, org.springframework.ui.Model model, @Valid @Valid UpdateQuantityForm form, org.springframework.validation.BindingResult bindingResult)
    • getOrderEntryData

      protected OrderEntryData getOrderEntryData(long quantity, String productCode, Integer entryNumber)
    • saveCart

      @RequestMapping(value="/save", method=POST) public 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 String exportCsvFile(javax.servlet.http.HttpServletResponse response, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) throws IOException
      Throws:
      IOException
    • applyVoucherAction

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

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

      public BaseSiteService getBaseSiteService()
      Overrides:
      getBaseSiteService in class AbstractPageController
    • setBaseSiteService

      public void setBaseSiteService(BaseSiteService baseSiteService)
    • executeCartEntryAction

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

      protected String getCartPageRedirectUrl()