When I click on the wishlist icon on the products list, it directs me to log in despite I am already logged in. REPEATED it more times but the same issue appears. How can I solve this issue?
This is the code in product-wishlist. liquid (snippet)
{% if customer %}
{% capture value %}{{ product.selected_or_first_available_variant.id }}{% endcapture %}
{% capture productID %}{{ product.selected_or_first_available_variant.id }}{% endcapture %}
{% for tag in customer.tags %}
{% capture tagID %}{{ tag }}{% endcapture %}
{% if tagID contains productID %}
{% capture value %}x{{ tagID }}{% endcapture %}
{% endif %}
{% if value.size == 0 %}{% assign value = productID %}{% endif %}
{% endfor %}
{% unless value.size == 0 %}
{% capture check %}{{ value.size | minus:productID.size | money_without_currency | times:100 | divided_by:2 }}{% endcapture %}
{% assign check = check | split:'.' %}
{% if check[1] contains "5" %}{% assign display = false %}{% else %}{% assign display = true %}{% endif %}
{% endunless %}
{% if display %}
{{ 'general.wishlist.add_to_wishlist' | t }}
{% else %}
{{ 'general.wishlist.added_to_wishlist' | t }}
{% endif %}
{% else %}
{{ 'general.wishlist.add_to_wishlist' | t }}
{% endif %}