{{customer.id}} doesn't work...

Highlighted
New Member
1 0 0

Hello, the output {{customer.id}} doesn't work... Does anyone know, why not? 

All the best,
Moritz

0 Likes
Highlighted
Shopify Partner
567 67 91

It is defined if customer is logged in

{% if customer %}
   {{ customer.id }}.
{% endif %}
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution

Skype : lokendra.panwar1
1 Like
Highlighted
Tourist
4 0 1

This approach works nicely for other things as well. I used it earlier today for products. Nice that you can wrap javascript in the liquid tags for another level of control.

{% if product %}
  var productId = {{ product.id }};
{% endif %}

0 Likes