Why doesn't the color swatch update if I change the file?

We cache color swatch files so they load faster since they won't change often. The trade off is that if you decide to change the swatch it won't be updated right away.

To force your swatches to update to the new image you've uploaded, you'll need to jump into the code briefly.

First, open up your theme code editor by navigating to /admin/themes, clicking Actions on your copy of your theme, and then Edit code.

Open these four files:

  • sections/featured-product.liquid
  • sections/main-product.liquid
  • sections/main-product-modal.liquid
  • snippets/product-card.liquid

You'll need to remove some code that needs to be done carefully, so it's best you back up the file first. If something goes wrong you can always follow these steps to revert the file.

Search and delete | split: '?' | first and you're all set:

assign color_image = value | handle | append: '.' | append: swatch_file_extension | file_img_url: '50x50' | prepend: 'https:' | split: '?' | first


In all four files the code should now look like this:

assign color_image = value | handle | append: '.' | append: swatch_file_extension | file_img_url: '50x50' | prepend: 'https:'