What are Configurable Swatches?

Configurable Swatches are a Magento feature that allow merchants to visually display the various options available for a configurable product. These options may be things such as colors or sizes. Instead of choosing a color from a drop-down list, customers are able to make their selection by clicking a swatch.

Swatches allow for a more appealing and informative way of presenting merchandise, and Magento allows these to be used on product pages, category pages, and in layered navigation.

Prior to Magento version 1.9, the swatch feature was not available by default in Magento and those seeking this functionality would need to install a module.

Below is the swatch feature in Magento 1.9 (using the RWD theme) for a product page. In this example, the swatch is being used to indicate the various combinations of colors and sizes available.

Magento 1.9 Swatches - RWD theme - product page

Below is the swatch feature in Magento 2.0 (using the Luma theme) for a category page. We will demonstrate setting up a Configurable Swatch in Magento 2.0 in a future post.

Magento 2.0 Swatches - Luma theme - category page

Swatches are not limited to product and category pages, they can also be used in layered navigation, if the Use in Layered Navigationproperty of the attribute is set to “Yes.”


How to set-up Configurable Swatches in Magento 1.9.x

STEP 1) Create (or properly configure) the Attribute that will be used for the Configurable Swatches. Be sure that A) the attribute's Scopeis set to "Global", B) that the Catalog Input Type for Store Owner is set to "Dropdown", C) that the Apply to is set to "Configurable Product", and D) that Use To Create Configurable Product is set to "Yes".

Magento 1.9 Swatches - attribute config 1

Also, be sure to specify the values that will be used for the Configurable Swatch. In our example below, the values are "blue", "green", and "red". (see image below)

Screen Shot attribute configuration

It is also important to make sure the attribute is assigned to the Attribute Set that will be used to create the configurable product (outlined in STEP 3).

STEP 2) Enable Configurable Swatches on your Magento store. To do this, log into your Magento Admin Panel and go to the System > Configuration menu option. Within the CATALOG section on the left, select the Configurable Swatches tab and expand the General Settings tab.

Next, do the following: A) set the Enabled value to “YES”, B) select the Product Attributes to Show as Swatches in Product Detail that is to be used for the Configurable Swatches, and C) select a Product Attribute to Use for Swatches in Product Listing value (in the image below, we select the Color value).

Magento 1.9 Swatches - config 1

STEP 3) Create Your Configurable Product that will make use of the Configurable Swatches feature. It is important to remember that your Configurable product must use the attribute that has been selected for use as a Configurable Swatch in STEP 2 B (in our example, it is the Color attribute).

There are a couple of different ways you can go about making a Configurable product; you could make the Simple products first and then associate them to the configurable product when you create it, or you could create the Configurable product first and use the Quick simple product creation tool to make the associated Simple products.

It is important to note that the images added to Simple products must be named according the values specified in the Attribute that is used for the Configurable Swatch. In our example, it is the colors "blue", "green", and "red".

STEP 4) Adding Global Swatch Images. There two ways you can add the Global Swatch Images. The first way is to copy the images to the base Magento install directory at /media/wysiwyg/swatches. Alternatively, you can use you WYSIWYG editor to add the images to the Media Storage area. In both instances, you may need to create the /swatches folder.

Uploaded images should be of the .png format. Swatch images that are uploaded to Media Storage are globally available and can be used by any product. The name of each uploaded image file must exactly match the attribute value that it represents.

If there isn’t an image available for a swatch, the attribute value appears as text. A text-based swatch will appear as a button with a text label, and it will behave like a swatch with an image. Text-based swatches can be used for sizes. If the size attribute values were “Small,” “Medium,” and “Large,” rather than numbers, then that text would appear in the swatches instead.

STEP 5) Re-Index and Clear the Cache. You can Re-Index by going to the System > Index Management menu option, and selecting the specific indexes requiring re-indexing and press the Reindex button. You can clear the cache by going to System > Cache Managementmenu option, and clear Magento cache.

As you can see, swatches are particularly effective for colored products but can also be used for sizes and  multicolored products such as shoes or jackets.

Configurable Swatches are a powerful merchandising tool that enable merchants to display products in an appealing and informative way. Swatch functionality is not limited to colors, patterns, or sizes, they can use any type of attribute... allow your imagination to run wild.