I’ve written a script to replace the default dropdown menu for my colour variants to be colour swatches. (Code below.)
Problem:
The script is running fine, but the images I’ve uploaded to ‘Assets’ aren’t displaying on the frontend and I think it may be the file naming convention that’s stopping it.
Colour variant example:
‘Cool Dark Blue’
Tried file names:
‘Cool Dark Blue.jpg’
‘cool-dark-blue.jpg’
I’ve also tried using ‘.png’ format to no avail.
Any help would be greatly appreciated, thanks.
Tom
{%if option.name == "Colour"%}
{%assign index = forloop.index %}
{%for value in option.values%}
{%endfor%}
{%else%}
Exact file names uploaded: (Iunderstandthat Shopify adds underscores to replace spaces in filenames by default, so I have renamed them within Shopify to remove them.)
'Cool Dark Blue.png" 'cool-dark-blue.png
'Vibrant Red.png" “vibrant-red.png”
Exact Option name(Same in .CSV and image alt text)
Colour