Automatically Fall-back to the Preferred Warehouse of your Customer
When dealing with complicated rules around distribution of goods in e-Commerce, Episerver Commerce luckily out-of-the-box ships with support for distributed fulfillment centers. It relies on a concept of Warehouses, being entities representing the physical distribution facilities – e.g. a in-store pick-up location or a distribution center.
In many Episerver implementations, the Episerver developer is, as part of the creation of the individual shipments of an order, assigning the warehouse to be given responsibility of the fulfillment. We though frequently see, especially within B2B e-Commerce implementations, that the distribution facility, rather than being driven by item availability, is selected according to a customer’s preference or by the location of his/her’s financial headquarter.
Like you see, the implementation is pretty straight forward and shows the concept of how you can customize the assignment of a warehouse for a given shipment. We are, for the sake of simplicity, simply retrieving the preferred WarehouseCode from a “PreferredWarehouse” meta-field associated to the contact’s organization*. As with any adjustment of Episerver’s pre-built behavior, you are required to replace the default implementation in Structuremap.
*Please have in mind this snippet has to be optimized prior to being used in any production system – it even requires a new meta-field to be added to your Organization Meta Class through BusinessFoundation. See Episerver’s documentation for more information.