Multiple Shopify Stores for Multiple Currencies - How to Grab the Store URL from a Query

12 replies
Last updated: Oct 3, 2022
Hi there, I’m trying to use multiple Shopify stores to display multiple currencies. Is there is way to grab the store URL from the query? I’m using the Shopify <> Sanity official app but unfortunately I can’t find any data related to the currency or store ID. Also did you guys managed to fetch the metafields values?
I don't have much experience with Shopify Connect, but this example document include a gid, which may be what you're looking for. If not, you can probably create a custom sync handler that adds that information in!
Hi
user M
thanks for your help! Unfortunately the gid doesn’t allow me to group the products by store or currency. I saw the custom sync handler doc so I’m going to try this way but I’d prefer to avoid this additional step.
I don’t know if there is a lot of demand on this feature but IMO being able to fetch products from multiple stores is a must have for big international Shopify websites. Usually the best way to handle multiple currencies and stock per region on Shopify is by having one store per currency/region. Shopify Market is out since a few months but the conversion fees are way too high.
Here is the architecture I’m trying to build:
• User browse the website from France > products & collections from Shopify store A are used
• User browse the website from USA > products & collections from Shopify store B are used
Your connection with Shopify is very good and I’m impressed how real time it is. The only thing missing is the store ID
🥲
Let me ask the folks who built the connector if there's some way to get this!
Thanks
user M
!
I was also wondering why the product.collection array isn’t available in the product object. Right now there is no way to list products that are linked to a specific collection.
Ok, confirmed that you'll need to write a custom sync handler for this. I don't have experience writing them, so I can't guide you much more than that!
Ok thanks
user M
user M
I took some time to play with a custom sync handler. Here is the payload I receive on each request:
The Connect App doesn’t give me access to the product.collections array.
The payload is exactly the same as the data I have in the data lake, so there is no way for me to know from which Shopify store the data is from
Also here is a collection payload
There is no link between a collection id and a product id which is too bad

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?