jquery - Check if current customer is an admin in Shopify?
I would like to add a conditional on some pages in my Shopify theme that displays more info if the user viewing the page is an admin (and is logged in). Is there a way to do this? The obvious way is to check the customer.email property against some hard-coded values that belong to admins. But that's a maintenance headache and a poor design. Is there a better way?
There is no list of Shop accounts available to check against. The only check you could make against is the shop email address or the shop customer_email and that is kinda loser-ish.
You're in tough on this one as Shopify does not yet provide any Shop accounts. Even the embedded SDK's for POS and WWW provide nothing more than "this user is an admin, or this user is a staff account", but no identifying data.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.