Personalized checkout and custom promotions with Shopify Scripts
This question is asking how to display the name of the currently logged-in customer on a Shopify store. The solution uses Shopify Liquid, a templating language designed for Shopify themes, to check whether a customer is logged in and, if so, display their first name.
Solved! Go to the solution
This is an accepted solution.
Hello! @bevesa4326 Please follow these steps to add this code:
1. Go to your Online Store
2. Click on "Themes"
3. Select "Edit code"
4. Open main-account.liquid file.
6. Add the following code to replace of this code <h1 class="customer__title">{{ 'customer.account.title' | t }}</h1> Same as IMG
{% if customer %}
<h1 class="customer__title">Welcome, {{ customer.first_name }}!</h1>
{% else %}
<h1 class="customer__title">Welcome, Guest!</h1>
{% endif %}
If you need further assistance, please let me know. If you found my help useful, consider liking this message and marking it as the Accepted Solution.
Best regards
K.K
Hi @bevesa4326
To check if the customer is logged in and to show customer's name use the below code where you want to show the customer name
{% if customer %}
<p>{{customer.first_name}}</p>
<p>{{customer.last_name}}</p>
{% endif %}
Thank you @Huptech-Web for your quick answer and help. I appreciate your assistance 🫰
This is an accepted solution.
Hello! @bevesa4326 Please follow these steps to add this code:
1. Go to your Online Store
2. Click on "Themes"
3. Select "Edit code"
4. Open main-account.liquid file.
6. Add the following code to replace of this code <h1 class="customer__title">{{ 'customer.account.title' | t }}</h1> Same as IMG
{% if customer %}
<h1 class="customer__title">Welcome, {{ customer.first_name }}!</h1>
{% else %}
<h1 class="customer__title">Welcome, Guest!</h1>
{% endif %}
If you need further assistance, please let me know. If you found my help useful, consider liking this message and marking it as the Accepted Solution.
Best regards
K.K
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