Besides the product itself, customers consider two things when making a purchase decision. The first is the price of the product, and the second is the delivery lead time, or how long it will take for the order to arrive at their doorstep.
Providing an accurate delivery lead time is not an easy task. It is essentially a promise date that needs to be met by the organization. If you are too optimistic and don't deliver on time, you risk making the customer unhappy. Instead, by showing a longer expected delivery time (or not showing one at all) you risk losing customers who want their order to be shipped as soon as possible.
As a developer, you will likely have no voice when it comes to setting promise dates, but it is your responsibility to build a system that supports all scenarios. Delivery lead times can be affected by a number of factors that can become very complex. It is also a calculation that needs to be done in real time because stock availability changes with each order, or even with each "add to cart" if a stock reservation mechanism is provided.
I know it sounds intimidating, but it is. In all honesty, I can tell you that this has been one of the most sophisticated features that we've built into Commerce Layer. But even if you can rely on a simple inventory API, understanding how an availability message is created will allow you to design more effective models. So let's explore some scenarios, starting with the easiest and adding complexity as we go along.
Case 1: One stock location, one shipping zone
Shipping orders from a single location, such as a warehouse, is the simplest scenario. If the product is in stock at that location, then it's available. Otherwise, it's not. If you only support one shipping zone, such as your domestic market, the delivery lead time will be solely based on the shipping method chosen by the customer.
As the shipping zone is unique, the shipping methods available to the customer won't depend on the shipping address. Therefore, you can display a shipping option directly on the product page. For example, you can show the fastest method to promote "Express" delivery or the cheapest one to make it more appealing from a cost perspective. Or you can decide to show both for full transparency.
Upon placing an order, only one shipment will be sent from the warehouse. The logistics department will prioritize express deliveries over standard ones.
Case 2: One stock location, multiple shipping zones
If the same stock location serves multiple shipping zones, customers may experience longer delivery lead times when shopping from a market that is not served by a local warehouse.
For identifying the shipping zone that the customer belongs to, you need to collect more information about their shipping address. When your shipping zones vary by country, you can simply use the country selected by the customer at the beginning of their shopping session. If, however, your shipping zones are more detailed (e.g., they are based on ZIP codes), you will need to ask the customer for more information about their address, or you can keep the availability message generic on the product page and show all shipping options when you know the customer's address at checkout.
After an order is placed, there will only be one shipment from the warehouse. As logistics may pick different shipping providers for different zones, it is important to report this information with the order or map the shipping zones and carrier accounts upfront.
Case 3: Multiple stock locations, multiple shipping zones
Things get interesting when inventory is distributed across multiple locations, such as multiple warehouses or physical stores. The availability of a product is no longer a true/false flag. The delivery lead time will depend on the location of the stock, other than the shipping zone of the customer, and the shipping method selected.
Multiple stock locations are typically prioritized differently for different shipping zones. If you have a warehouse in the US and one in the EU, for example, the US warehouse will be selected with higher priority when shipping to US customers, while the EU warehouse will be chosen first when shipping to European customers.
According to the example above, when the US warehouse does not have enough stock, the business might ship to the US from the EU warehouse to maximize stock availability. In this case, there would be a longer delivery lead time, but at least the item would be available.
Delivery lead times can also be affected by the quantity requested. A product could be in stock but at different locations. If this is the case, the order may be divided into multiple shipments, one for each location, or the customer might choose to receive only one shipment with the slowest delivery time.
In general, the more stock visibility you give your customers, the better. Amazon's empire is built on its logistics system and their order splitting logic is already visible during checkout. You may consider implementing a similar model in you online store, in order to meet your customers’ expectations and provide them with an experience of the same quality.