1

I need to created multiple orders from one cart based on specific items the products have.

I have already split the entries so I have multiple carts on which I call the getBolCartFacade().placeOrderFromCart().

I get two separate orders in which the first one contains the right items but is missing data like shipTo etc.

The second one has all data but also all items the initial cart had in it.

Could anyone point out how/where I have to generate the separate carts?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
pr191ex
  • 88
  • 1
  • 14

1 Answers1

3

You can check DefaultCommercePlaceOrderStrategy and DefaultCreateOrderFromCartStrategy strategies for manipulating process. On the other hand, creating multiple order from a cart not feasible because of promotions and delivery. Some promotions and delivery fee calculated from single cart. When you split a cart to multiple order, calculation consistencies fail.

On the other hand hybris has consignment functionality, why didn't you use it?

What is your prospect with splitting cart to multiple order?

mkysoft
  • 5,392
  • 1
  • 21
  • 30
  • I can not use consignments because in the end i need two independent orders in the ERP so the order has to be splitted before it gets there – pr191ex Jan 16 '19 at 08:08
  • Which integration do you use with ERP? Which system making the calculation (promotion, tax, delivery), ERP or hybris? – mkysoft Jan 16 '19 at 08:15
  • SOM, delivery gets calculated in billing process and shouldnt affect this process – pr191ex Jan 16 '19 at 08:33
  • SOM is a part of hybris billing? – mkysoft Jan 16 '19 at 08:35
  • Delivery will be calculated by erp, so i dont need to mind them in the hybris order process – pr191ex Jan 16 '19 at 08:38
  • Maybe you can split cart before placing order. There are existing cart service (DefaultCartService, DefaultCommerceSaveCartService) and strategies (DefaultCommerceCloneSavedCartStrategy) exist for doing this. – mkysoft Jan 16 '19 at 08:52
  • I just rechecked it, promotions are not supported and delivery is, as i answered in the other comment, calculated by sap after placing the order. So this means i can use the services you mentioned to split my cart? – pr191ex Jan 16 '19 at 08:57
  • 1
    If you split cart, system will add delivery fee to everyone. @pr191ex you can duplicate cart, remove product from carts for making them split and then recalculate cart with these service and strategies. But I am not sure this is your best solution. Because there are a lot of missing information and expected results. I think you need make new meeting with your ERP team and give information about we can not create multiple order from one cart in hybris. Then search best solution. There are a lot of way to handle process in ERP side. – mkysoft Jan 16 '19 at 11:28
  • I cant generate the second card with the right items, every time the system checks consistency with sap cart (jco call) my item list gets overwritten, you have any clues? – pr191ex Jan 17 '19 at 15:14
  • My knowledge there is no cart on SAP side, we have sales order. May be your team develop custom objects. You need to manage data flow and create cart on SAP side after multiplexing. On the other hand cart/order live sync is not recommended for performance issues. – mkysoft Jan 17 '19 at 15:26