Watch a live product demo 👀 See how Sanity powers richer commerce experiences

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?
Sep 28, 2022, 4:13 AM
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!
Sep 28, 2022, 3:31 PM
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
🥲
Sep 28, 2022, 4:06 PM
Let me ask the folks who built the connector if there's some way to get this!
Sep 29, 2022, 6:05 PM
Thanks
user M
!
Sep 29, 2022, 6:08 PM
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.
Sep 29, 2022, 6:11 PM
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!
Sep 30, 2022, 4:00 PM
Ok thanks
user M
Sep 30, 2022, 4:03 PM
user M
I took some time to play with a custom sync handler. Here is the payload I receive on each request:
Oct 3, 2022, 8:22 PM
The Connect App doesn’t give me access to the product.collections array.
Oct 3, 2022, 8:23 PM
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
Oct 3, 2022, 8:24 PM
Also here is a collection payload
Oct 3, 2022, 8:26 PM
There is no link between a collection id and a product id which is too bad
Oct 3, 2022, 8:26 PM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in

Related answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
After adding the subtitle and running this code npm run graphql-deploy It does nothingSep 15, 2020
how to limit a reference to just one entry in Studio reference input side versus the default as-many-entries-as-you-fill-in-an-array...Sep 18, 2020
Is it possible to fetch more than one "_type" using GROQ?Nov 2, 2020
I want to add a view with the Structure builder (S.view.component) where I list similar documents based on the title. What...Sep 23, 2020
Is there a structure builder example where the format of each preview for the document list is modified?Feb 3, 2021
I have an array of references to a country schema type but it always just returns NULL values for meJan 30, 2021
Hi, I need help with a query for getting the url of an image asset. Here is what I've been trying, but I only get the _ref...Dec 1, 2020
Sanity UI looks brilliant :smiley: Is something like the current date picker possible at the moment? I’m not sure if anicon...Dec 21, 2020
Hey everyone. I have been coding and may have potentially accidentally deleted something. Does anyone know how to resolve...Dec 26, 2020
Hello everyone and happy new year :raised_hands::skin-tone-2:, I have a problem with outputting Portable Text :disappointed:...Jan 1, 2021

Related contributions

Clean Next.js + Sanity app
- Template

Official(made by Sanity team)

A clean example of Next.js with embedded Sanity ready for recomposition.

Cody Olsen
Go to Clean Next.js + Sanity app

Blog with Built-in Content Editing
- Template

Official(made by Sanity team)

A Sanity-powered blog with built-in content editing and instant previews.

Go to Blog with Built-in Content Editing