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

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.

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

{{customer.first_name}}

{{customer.last_name}}

{% endif %}
1 Like

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.
  5. Add the following code to replace of this code

    {{ ‘customer.account.title’ | t }}

    Same as IMG

{% if customer %}
 # Welcome, {{ customer.first_name }}!
{% else %}
 # Welcome, Guest!
{% 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

1 Like

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

1 Like