In my project client needs to have multiple warehouses each one being fulfillment centre. They want shipment to be splitted based on warehouses as user add item to cart. I need to add radio button on prodduct details page, so that user can select warehouse they want the item from. The current documentaion in episerver only talks about workflow. We do not use work flow. If anybody had faced this type of situation and found solution please give some guidelines.
As soon as you introduce more than 1 warehouse that is marked as a fulfilment centre, Episerver Commerce will raise an exception indicating that you need to implement routing logic to decide which warehoues each shipment should use.
Your lineitems in the cart can be extended (using the appropriate metadata system) to carry a field that holds the selected warehouse.
When processing the order, you will want to create a shipment for each unique warehouse from the lineitems, and implement the routing logic to base its warehouse decision from the warehouse indicated by the lineitems in the shipments.
That'd should be enough, you don't have to write custom code for processing those shipments, because they should be handled by Commerce out of the box.
Thank You, for your responses. I have modifed the product details page to display availability option to the user, so that they can select warehouse along with quantity and other stuffs while adding to cart. I get any existing shipment in the cart by warehousecode or create new and add the lineitem to the shipment. This is working as expected. Now, working on checkout. Hopefully, everything is handled by commerce as mentioned by Quan Mai.