We are wanting to add multiple items (different items, NOT same item with quantity) to the cart with one call.
Currently with 1 item,
Code: Select all
@ActionMapping("add")
public void add(ActionRequest request, ActionResponse response, Model model,
@ModelAttribute("addToCartItem") AddToCartItem addToCartItem) throws IOException, PricingException, AddToCartException {
System.out.println("CartPortletController.add()");
super.add(PortalUtil.getHttpServletRequest(request), PortalUtil.getHttpServletResponse(response), model, addToCartItem);
}
is invoked using a
Code: Select all
<form name="addItem" method="POST" liferay:action="action='add', lifecycle='ACTION_PHASE'">
...
New to Spring, but I have been unsuccessful adding multiple items using below
Code: Select all
@ActionMapping("action=addMultipleItems")
public void addMultipleItems(ActionRequest request, ActionResponse response, Model model, ArrayList<AddToCartItem> addToCartItems)
Not sure how this looks in a form.
What I'm considering is
Code: Select all
@ActionMapping("action=addMultipleItems")
public void addMultipleItems(ActionRequest request, ActionResponse response, Model model, String[] addToCartItems) {
Then build the AddToCartItem somehow, then call super.add multiple times?
If there is a way to make one call to the BroadleafCartController to add multiple items, please let me know.
Jason