on 05-22-2015 1:32 PM
Is there any way I could bulk upload the products into the cart within a batch? The addToCart(...) method of CommerceCartService adds one product at a time.
There is something in the B2B accelerator that might help you:
/hybris/bin/ext-accelerator/b2bacceleratorfacades/src/de/hybris/platform/b2bacceleratorfacades/order/impl/DefaultB2BCartFacade.java
it implements the method:
public List<CartModificationData> addOrderEntryList(final List<OrderEntryData> cartEntries)
Used by
/hybris_b2c/bin/ext-template/yb2bacceleratorstorefront/web/src/de/hybris/platform/yb2bacceleratorstorefront/controllers/misc/AddToCartController.java
@RequestMapping(value = "/cart/addGrid", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public final String addGridToCart(@RequestBody final AddToCartOrderForm form, final Model model) {
List<OrderEntryData> orderEntries = getOrderEntryData(form.getCartEntries());
final List<CartModificationData> modifications = cartFacade.addOrderEntryList(orderEntries);
model.addAttribute("modifications", modifications);
model.addAttribute("numberShowing", Config.getInt(SHOWN_PRODUCT_COUNT, 3));
for(CartModificationData modification : modifications)
{
addStatusMessages(model, modification);
}
return ControllerConstants.Views.Fragments.Cart.AddToCartPopup;
}
The data is posted there by the view:
/hybris/bin/ext-template/yb2bacceleratorstorefront/web/webroot/WEB-INF/views/desktop/pages/product/productOrderFormPage.jsp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.