What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Get a list of all store Locations inside Checkout UI Extension

Get a list of all store Locations inside Checkout UI Extension

jamalali81
Shopify Partner
25 0 4

Is it possible to fetch all our store Locations from within a Checkout Ui Extension? I need to be able to set the location name where the order will be fulfilled from as an order attribute.

Replies 4 (4)

Liam
Community Manager
3108 344 895
Hi Jamalali81,
 
You should be able to fetch store locations from within a Checkout UI Extension using the Storefront API - specifically by using the `locations` query

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jamalali81
Shopify Partner
25 0 4

Thanks @Liam! I did try that but it doesn't return any results. According to the docs this is a "List of the shop's locations that support in-store pickup." I need to be able to fetch all locations, not just those that support in-store pickup.

Liam
Community Manager
3108 344 895

Hi again Jamalali,

 

You could try setting up an approach where you access the locations API (which would return a list of active inventory locations) with a backend service and then from within the Checkout UI Extension, you could make AJAX/fetch requests to your backend service to fetch location info. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

TonioLHG
Shopify Partner
2 0 1

Hi Liam, 

From within a Checkout UI Extension, is it possible to retrieve the locations used to fulfilled the current order? 

 

Thank you!