Wondering just like the storefront in customer accounts how can we identify the market of the logged in user.
In shopify we use the locale, country and currency available in the window.Shopify object to deduce this information. Is there something similar available for access within customer accounts too?
Hey @Sakshi_Gupta - there’s not an easy way to grab the market directly through Customer Account API extensions, but you definitely can do something similar to your current set up through the Customer Account Extension framework’s localization API:
This should give you access to the customer’s localized language and currency.
Hope this helps - let me know if I can clarify anything on our end here
Hey @Alan_G So will this be the Localisation as per the market they are in or as per the geolocation of the user?
In shopify we can change the market of the store through a dropdown in the ui and this market might not be necesarily my gelocation. I am looking for answers where I can grab that information
Equivalent of
Shopify.country, Shopify.locale, Shopify.currency in the Storefront
I think the customer account localisation will give me their localised language right not the markets?
Thanks for clarifying what you’re looking for, really appreciate it! You’re right that the Customer Account UI Extension’s localization API generally only provides language/locale information for translation purposes.
The useLanguage() hook gives you the buyer’s language preference and the currency formatting of their locale, but there’s no direct equivalent to Shopify.country or Shopify.currency (like in the window.Shopify object) that would tell you which market they’re on definitively.
I’ll do some more digging into this to see if I can confirm that there isn’t a workaround or that there isn’t a way to pull the market data directly via the Customer Account API and loop back with you here once I have that confirmation.
Hey @Sakshi_Gupta I spoke with a few folks and it looks like the useLocalizationCountry hook should return the customer’s current country, so I just wanted to share that as a possible workaround for you here.
That said, we don’t surface the specific market info (like the market ID, etc.) through the Customer Account API at the moment, but I am definitely happy to set up a feature request for you to pass along to our product team. If you’re open to sharing more of your app’s use case/functionality with you me I can include that in my report that I’ll set up on my end - hope to hear from you soon!