We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How can I set a default value for customer's first name?

How can I set a default value for customer's first name?

ajmurray1234
Tourist
8 0 1

Hello,

New to shopify and trying to figure out how to use a default value in the case where I do not have a customer's first name. I found a snippet of code online but it did not work as expected.

Dear {{ customer.name | default: "customer" }},

Thanks!

Reply 1 (1)

Litos
Globetrotter
688 169 150

Hi @ajmurray1234,

Please change code:

{% unless customer.name == blank %}
Dear {{ customer.name }},
{% else %}
Dear customer,
{% endunless %}

Hope it helps!

Litos - Shopify Development Service Provider
Need to develop or customize your Shopify store, feel free to contact us here.