When I click on wishlist it directs me to contact form to login even though custom already logged in

When I click on wishlist it directs me to contact form to login even though custom already logged in

Abduali
Tourist
10 1 0

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)

 

<div class="product-addto-links">
{% 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 %}
<form accept-charset="UTF-8" action="{{ shop.url }}/contact#contact_form" class="wishlistForm" method="post">
<input value="customer" name="form_type" type="hidden">
<input name="utf8" value="✓" type="hidden">
<input type="hidden" name="contact[email]" value="{{ customer.email }}"/>
<input type="hidden" name="contact[tags]" value="{{ value }}" />
<button class="btn btn_df" type="submit" title="{{ 'general.wishlist.add_to_wishlist' | t }}">
<i class="fa fa-heart"></i>
<span class="hidden-xs hidden-sm hidden-md">{{ 'general.wishlist.add_to_wishlist' | t }}</span>
</button>
</form>
{% else %}
<a class="btn_df btnProduct added" href="/pages/wishlist" title="{{ 'general.wishlist.added_to_wishlist' | t }}">
<i class="fa fa-check"></i>
<span class="hidden-xs hidden-sm hidden-md">{{ 'general.wishlist.added_to_wishlist' | t }}</span>
</a>
{% endif %}
{% else %}
<a class="btn_df btnProduct" href="/account/login" title="{{ 'general.wishlist.add_to_wishlist' | t }}">
<i class="fa fa-heart"></i>
<span class="hidden-xs hidden-sm hidden-md">{{ 'general.wishlist.add_to_wishlist' | t }}</span>
</a>
{% endif %}
</div>

 

 

Replies 0 (0)