Trying to generate data from a metafield on each location

Topic summary

Goal: show an alert on product pages when an item is out of stock, displaying a general timeframe for next shipping.

Data source: a metafield created on Shopify Locations (Settings > Locations: https://admin.shopify.com/store/ACCOUNT/settings/locations/). The timeframe must be editable per location.

Need: the Liquid code/snippet to read a location metafield in a template, ideally selecting the value for the location the product ships from. The asker expects a dynamic snippet similar to {{ settings.color_scheme }} or {% render ‘meta-tags’ %} but for location metafields.

Constraints: products remain purchasable when out of stock (continuous restocking); developers can implement the display once the metafield value is accessible.

Artifacts: a screenshot shows the location metafield configuration; it’s central to understanding the setup.

Status: no solution provided yet; guidance on accessing location metafields in theme code is requested and the question remains open.

Summarized with AI on January 9. AI used: gpt-5.

I want to display an alert that shows up when a product is out of stock, which will show general timeframes of when the product will be next shipping. I have added a meta field to the locations in the backend, but I can’t seem to find the code that I can drop into the template to generate this data - I would expect I could do this depending on the location that the product is shipped from, which are all set up at:

https://admin.shopify.com/store/ACCOUNT/settings/locations/

I would have expected that this would just be a dynamic code snippet that Shopify provides, such as “{{ settings.color_scheme }}” or “{% render ‘meta-tags’ %}”.

In the way of displaying the message, I have developers that can take this tag, and then work out how to generate the right info, but the timeframe itself needs to be updatable on the locations themselves. Note; products will be set to continue selling once out of stock, as there’s always fresh stock arriving, hence the note.

Any help here would be so very much appreciated.

1 Like