Why isn't my liquid code redirecting to other product pages?

Topic summary

A user is experiencing an issue with custom Liquid code designed to display product color variants on a Shopify product page. The code successfully shows images of other available colors, but clicking these images doesn’t redirect to the corresponding product pages.

Technical Details:

  • The original code uses metafields (product.metafields.custom.other_available_colours) to pull variant information
  • Images display correctly but lack functional links
  • The code appears to be intentionally reversed/obfuscated in the original post

Attempted Solution:

  • A helper provided corrected Liquid code that assigns variant IDs and creates proper links
  • The suggested code snippet was incomplete in the conversation

Current Status:

  • The proposed fix did not work and actually removed the images entirely
  • The issue remains unresolved
  • The product in question is the “Scuffette II Ladies Mule Slippers” available in multiple colors
Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

Hello!

The product below is available in 3 other colours. I have embedded liquid code to display them but when i click the pic of another colour, it doesn’t take me to the page of that product. Anyone know i can go about fixing this?

liquid code is ;

Other Available Colours

{% for field in product.metafields.custom.other_available_colours.value %} {% endfor %}

thanks!

1 Like

Hello There,
Please share your store URL and Password.
So that I will check and let you know the exact solution here.

https://house-of-slippers-uk.myshopify.com/products/scuffette-ii-ladies-mule-slippers-chestnut?variant=44216490328284

house

The product is the Ugg Scuffette Chestnut

Hello @WBYS_Ltd

Please added this code.


  ## Other Available Colours
  
    {% for field in product.metafields.custom.other_available_colours.value %}
      {% assign variant_id = field.variant_id | plus: 0 %}
      {% assign variant = product.variants | where: 'id', variant_id | first %}
      {% if variant %}
        
          
        
      {% endif %}
    {% endfor %}
  

Hi I’ve added the code but it has not worked and removed the images