Automatically Fall-back to the Preferred Warehouse of your Customer

casper.rasmussen/ December 11, 2017/ Episerver Commerce/ 0 comments

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.

Happy Coding!

Leave a Comment

Your email address will not be published. Required fields are marked *

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>