You can create a members-only store by showing a login or register page when customers navigate to your website. To make your store accessible only to registered customers, you need to edit your Customer accounts settings in the admin, and add some Liquid code to your theme.
Note: If you want only certain pages to be members-only, then you need to install an access management app from the Shopify App Store.
theme.liquid
.<head>
tag in the code. On a new line below the opening <head>
tag, paste the following code:{% unless customer %}
{% if template contains 'customers' or request.path == "/challenge" %}
{% assign send_to_login = false %}
{% else %}
{% assign send_to_login = true %}
{% endif %}
{% endunless %}{% if send_to_login %}
<meta content="0; url=/account/login?checkout_url=/" http-equiv="refresh" />
{% else %}
</body>
tag in the code. On a new line below the closing </body>
tag, paste the following code:{% endif %}
Customers that log in are automatically redirected to the home page of the shop. You can edit where customers are redirected by editing the meta refresh tag URL in the code you just pasted.
<meta>
tag in the file:<meta content="0; url=/account/login?checkout_url=/" http-equiv="refresh" />
checkout_url=/
. For example, if you want your logged-in customers to go to your catalog page when they navigate to your site, add collections/all
to the URL path. Your code should look like this:<meta content="0; url=/account/login?checkout_url=/collections/all" http-equiv="refresh" />
TyW | Online Community Manager @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
This is exactly what I want do to. I have made my page member only access, but I want it to be only if you have a certain tag. Where do I insert the coding you @martinhalik mentioned
{% for tag in customer.tags %}
{% if tag contains 'savage' %}
Well well well...
{% endif %}
{% endfor %}
Thank you!
Not remember exactly but you can put it on specific page template you want to restrict. Or for whole store you can put it in theme.liquid around {{ content_for_layout }}
You will see what it does and then you can proceed based on that.
Here is something similar with demo https://www.youtube.com/watch?v=oNegu1CmV64
Hope it helps.
Hi if we only want a portion of our site (and it's products) to be a "Members Only Area" that requires registration + login (so we can capture emails and ensure they read our Members Area Terms & Conditions) –how would we do that?
[!] Requirements/Desires:
@HouseOfEnergy
If you're comfortable with Liquid, see this post.
If not, see our blog on this topic: How to Create a Shopify Membership Site and Restrict Access to Your Shopify Store
If you're already using Customer Fields for your members-only store, contact support@heliumdev.com.
User | RANK |
---|---|
224 | |
60 | |
48 | |
25 | |
24 |