user
object contains information about logged-in customers when the login/account feature is enabled in your store. It’s used to create account management functionality and personalized experiences.
Usage: Available globally when
shop.login_active
is true - check login status and display account-related contentBasic Usage
The user object helps you create login/logout functionality and personalized content:Available Properties
Property | Type | Description |
---|---|---|
user.logged_in | Boolean | Check if visitor is logged in |
user.login_url | String | Output link to Login / My Account page |
Conditional Content Examples
Personalized Header
Account Dashboard Link
Checkout Experience
Complete Examples
Responsive Account Menu
Mobile-Friendly Account Section
Implementation Notes
Feature Check
Always wrap user object usage with
{{#shop.login_active}}
to ensure the feature is enabledLogin URL
The
user.login_url
leads to the same page for both login and account managementLogout Handling
Logout is typically handled via
/logout
endpoint, not through the login_urlState Management
Use
{{#user.logged_in}}
and {{^user.logged_in}}
for clear conditional logic