Back to Theme support

How to add your language's word for "color" to enable color swatches

Your theme allows you to display product variants in drop downs or swatch buttons. When you have an option named color or colour, its options can be shown as words, a solid color or images. If the word you're using to display color swatches isn't one of these: color, colour, cor, farbe, or couleur, your color swatches will show as text swatches.

Go into your code (online store/themes/.../edit code).

For Icon, Mr. Parker, and Vantage, you'll look for these files:

​swatch.liquid
show-colors.liquid

On Fashionopolism and Testament, you'll be looking for 

swatch.liquid 
product-listing-swatches.liquid

On Drop, Foodie, and Forge, you'll be looking for 

snip-swatch.liquid
snip-product-loop-swatches.liquid

In swatch.liquid or snip-swatch.liquid, in the first couple of lines, you'll see this:

assign color_swatch_options = "color, colour, cor, farbe, couleur" | split: ", "

​Simply add your name there, so it'll look like this:

assign color_swatch_options = "color, colour, cor, farbe, couleur, stone" | split: ", "

In show-colors.liquid, product-listing-swatches.liquid, or snip-product-loop-swatches.liquid, you'll see a line towards the top that looks like this:

{% if downcased_option contains 'color' or downcased_option contains 'colour' or downcased_option contains 'cor' or downcased_option contains 'farbe' or downcased_option contains 'couleur' %}

In there, you also simply add your color name in that same format, so it'll look like this:

{% if downcased_option contains 'color' or downcased_option contains 'colour' or downcased_option contains 'cor' or downcased_option contains 'farbe' or downcased_option contains 'couleur' or downcased_option contains 'stone'%}