App reviews, troubleshooting, and recommendations
I have created a discount app and the app is designed to apply discounts exclusively to logged-in customers. How can I determine if a customer is logged in on the store?
You can use this code to check if the customer logged in
{% if customer %}
{% endif %}
You can check this to learn more about Shopify customer for dev
https://shopify.dev/docs/api/admin-rest/2023-10/resources/customer
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Hi @Dan-From-Ryviu the implementation is now functioning correctly. I've added this code snippet in theme.liquid to determine if the customer is logged in or not:
{% if customer %}
localStorage.setItem('isLoggedIn', 'true');
{% else %}
localStorage.setItem('isLoggedIn', 'false');
{% endif %}
However, I'm encountering an issue in the Shopify discount app while trying to read from localStorage. The error displayed is: 'Uncaught ReferenceError: 'localStorage' is not defined'. Any suggestions on how to resolve this?"
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025