[Bug Fix] Color swatches suddenly stopped working
Affected themes:
- ShowTime (version 7.0 and later)
- Galleria (version 3.0 and later)
- Multi (all versions)
- Nova (all versions)
We became aware that Shopify apparently released some update to the platform recently that has caused custom color swatches to malfunction. If you have custom color swatches uploaded to your Settings > Files area currently and they are now displaying as empty or plain white on your product pages, you likely have this issue. This article provides instructions on how you can patch your store to address this problem if you are experiencing it.
- From your Shopify dashboard, look for the Sales Channel heading on the left, then click Online Store > Themes and look for ShowTime
- Click the ... button and then Duplicate to create a backup of your theme. Note that this is an optional, precautionary step that we always suggest when editing code on your theme.
- Once the duplicate has been created, on your original ShowTime theme, click the ... button again, then Edit Code from the drop-down menu
- Navigate to the Snippets folder and click to open the file called swatch-color-style.liquid
- Replace all the code in this file with the code below and save your changes.
{% comment %}
Props
- value
{% endcomment %}
{%- liquid
assign img_file_name = value | handleize | append: '.png'
assign swatch_image = images[img_file_name]
assign swatch_image_url = img_file_name | file_img_url: '50x50'
if swatch_image != blank
echo 'background-image:url(' | append: swatch_image_url | append: ');'
else
echo 'background-color:' | append: value | strip | split: ' ' | last | downcase | append: ';'
endif
-%}
This should resolve the issue. If you have trouble applying this patch or are uncomfortable doing so, please feel free to reach out to our support team with your four-digit collaborator code and we can request access and make the adjustment for you. We apologize for the inconvenience caused.