How Do I Show the Current Customer's Name in Shopify?

Solved

How Do I Show the Current Customer's Name in Shopify?

bevesa4326
Visitor
2 0 1

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.

Accepted Solution (1)

Huptech-Web
Shopify Partner
1169 234 264

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

HuptechWeb_0-1742217157338.png

{% 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

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required

View solution in original post

Replies 3 (3)

Huptech-Web
Shopify Partner
1169 234 264

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 %}
If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
bevesa4326
Visitor
2 0 1

Thank you @Huptech-Web  for your quick answer and help. I appreciate your assistance 🫰

Huptech-Web
Shopify Partner
1169 234 264

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

HuptechWeb_0-1742217157338.png

{% 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

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required