Access Locations globally

Short description of issue

Cannot access Shopify Locations globally in Liquid

Reproduction steps

We use Locations for referencing retail stores and other types of inventory locations.

We would like to be able to loop through Locations on a page and list all locations with various information (opening hours, address, etc.)

At the moment it does not appear to be possible to access all Locations in Liquid wthout various hacks. This seems quite strange - why not provide a standard approach to this via a liquid variable?

Known workarounds

  1. Use Shopify Flow to maintain a Shop Metafield JSON containing locations
  2. Create a dummy product which has inventory activated on all locations, but stock set to 0. Then use this product to output all locations on a page using location availability list on the variant.

Additional info

Is this not a requested feature? We have a standard object for Locations, why can’t we use it?

Seems like the storefront API already supports this - why not liquid?

What type of topic is this

Feature request

1 Like

Hey @Evaldas_Raisutis :waving_hand: - thanks for reaching out. At the moment, you’re right that locations are essentially “gated” behind product variants:

I think using a Metafield is the more robust workaround, but I definitely understand not having locations in general available as Liquid objects isn’t ideal.

Would your use case essentially just be having a generic “locations” object that can be surfaced on any page which you could then use to show general location info per what you share there, that sort of thing? I can’t guarantee anything on my end, but I’m happy to check to see if this is on the roadmap or if I can log a feature request for you at the very least. Hope to speak with you soon!

Hi Alan,

Yes exactly - we would just like to be able to access locations globally, much like the storefront API already allows already. Having some parity between the storefront API and liquid in this area would save some headaches.

1 Like

Thanks @Evaldas_Raisutis - I’ll speak with some folks internally to see if we can confirm if this on the roadmap, and I’ll loop back here with you once I have more info to share. Appreciate your clarifications on this and speak with as soon as I have next steps :slight_smile:

Hey @Evaldas_Raisutis :waving_hand: - following up here. Just wanted to confirm this is something we’re looking at implementing in the medium term. I don’t have an exact turnaround time, but if you did have a specific shop/merchant you were working with that needed this implemented just let me know and I can look into this further for you!

Hope this helps!

Hey @Alan_G,

Hope its fine that I interfere. We do in fact have a merchant who needs this, as locations in this case refers to physical stores, but also stores that sell the products, including specific inventory to a selected store (location). A list of locations globally would allow us to present customers with a store selector. Customers can select pick up location from storefront homepage, and a store locator that shows store locations on a map, all from a single source.

Hi Alan, so awesome. As Mark (my colleague) has mentioned we do in fact have a concrete case for a Shopify Plus client, so it would be awesome if this could come sooner rather than later haha.

Hey @MarkAskoe and @Evaldas_Raisutis :waving_hand: thanks for following up! I’ll send you folks a DM here in a moment :slight_smile: