Shopify: Let customers know when products will be back in stock

Stephen Keable
3 min readDec 13, 2022

When a product goes out of stock on your Shopify store, you’ll probably have some code in your theme that shows a badge, to say the product is “Out of Stock” or “Sold Out”. This might raise the question from a customer of will it be back in stock and when?

If you are using Shopify’s Inventory Transfers system, then you can take advantage of a couple of properties in your theme, to tell the customer you have some new stock on order and when it’s coming back in.

So if you are in the habit of adding a Transfer when you place an order with a supplier, you can fill out the Shipment details fields, including the Estimated arrival date. The value of this field can be exposed in theme code.

Product page messaging

On the product page we can check the available property of the product’s variant to see if it is out of stock, this would be how we usually show a Sold Out message. However we can also check for the incoming property too, this will be true if an inventory transfer exists for the product variant.

So we can use the snippet below as a way for a single variant product to check if the product is out of stock, but has stock incoming, then show a “Back in stock soon” message to the customer. We can also make use of the next_incoming_date property to tell the customer when we expect the item to be available for sale next.

{%- if product.selected_or_first_available_variant.available == false -%}
{%- if product.selected_or_first_available_variant.incoming -%}
<p><strong>Back in stock soon</strong>
{%- if product.selected_or_first_available_variant.next_incoming_date -%}
<br><small>Expected {{ product.selected_or_first_available_variant.next_incoming_date | date: format: 'abbreviated_date' }}</small>
{%- endif -%}
</p>
{%- endif -%}
{%- endif -%}

Simple collection level badge

On a product card in a collection view, we might not want to show a date, however highlight that a product is not going to be out of stock for long…

--

--

Stephen Keable

Shopify partner, JavaScript/Liquid/Swift developer, convert to serverless architecture and builder of digital products people love to use since 1999.