Shopify themes, liquid, logos, and UX
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
User | RANK |
---|---|
62 | |
52 | |
47 | |
39 | |
38 |
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023