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

Topic summary

A logged-in customer is being redirected to a login/contact form when clicking the wishlist icon on product listings, despite already being authenticated. The issue persists across multiple attempts.

Code Context:

  • The problem occurs in the product-wishlist.liquid snippet
  • The code includes conditional logic checking if a customer exists and processes product variant IDs against customer tags
  • A form is rendered with wishlist functionality

Technical Details:

  • The snippet contains reversed/garbled HTML code (text appears backwards in sections)
  • Logic involves checking customer tags against product IDs to determine wishlist state
  • Form submission targets a contact form endpoint

Current Status:
The issue remains unresolved with no responses or solutions provided yet. The code formatting issues may be contributing to the malfunction, requiring debugging of the authentication flow and form action routing.

Summarized with AI on November 19. AI used: claude-sonnet-4-5-20250929.

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