Class AddConfigToCartController


@Controller public class AddConfigToCartController extends AbstractProductConfigController
CPQ Controller for actions that interact with the Cart, such as add to cart or update cart action.
  • Constructor Details

    • AddConfigToCartController

      public AddConfigToCartController()
  • Method Details

    • updateConfigInCart

      @RequestMapping(value="cart/{entryNumber}/configur*/addToCart", method=POST) public String updateConfigInCart(@ModelAttribute("config") @Valid @Valid ConfigurationData configData, org.springframework.validation.BindingResult bindingErrors, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, javax.servlet.http.HttpServletRequest request)
      Updates a configuration within the cart. In case the configuration contains any validation errors, the update cart action is canceled, and the user remains on the configuration page, so he can fix the validation errors.
      Parameters:
      configData - runtime configuration
      bindingErrors - error store
      model - view model
      redirectModel - redirect attributes
      request - http servlet request
      Returns:
      redirect URL, either cart if all was OK or configuration page in case validation errors
    • addConfigToCart

      @RequestMapping(value="/**/{productCode:.*}/configur*/addToCart", method=POST) public String addConfigToCart(@PathVariable("productCode") String productCodeEncoded, @ModelAttribute("config") @Valid @Valid ConfigurationData configData, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, javax.servlet.http.HttpServletRequest request)
      Adds a configuration to the cart, so that a new cart item will be created. In case the configuration contains any validation errors, the add to cart action is canceled, and the user remains on the configuration page, so he can fix the validation errors.
      Parameters:
      productCodeEncoded - code of the product the configuration belongs to
      configData - runtime configuration
      bindingResult - error store
      model - view model
      redirectAttributes - redirect attributes
      request - http servlet request
      Returns:
      redirect URL, either cart if all was OK or configuration page in case validation errors
    • resetConfiguration

      @RequestMapping(method=POST, value="/**/{productCode:.*}/reset") public String resetConfiguration(@PathVariable("productCode") String productCodeEncoded)
      Resets the existing configuration to its's default values and redirects to cart
      Parameters:
      productCodeEncoded - code of the product the configuration belongs to
      Returns:
      redirect URL