Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check user login or not in Shopify

{% if shop.customer_accounts_enabled %}
2	
  	{% if customer %}
3	
    	<a href="{{ routes.account_url }}">Account</a>
4	
  	{% else %}
5	
    	<a href="{{ routes.account_login_url }}">Login</a>
6	
7	
    	{% if shop.customer_accounts_optional %}
8	
      	<span>or</span>
9	
      	<a href="{{ routes.account_register_url }}">Create an account</a>
10	
    	{% endif %}
11	
  	{% endif %}
12	{% endif %}
Source by shopify.dev #
 
PREVIOUS NEXT
Tagged: #check #user #login #Shopify
ADD COMMENT
Topic
Name
4+7 =