Set up Magento 2 Configurable Swatches

Set up Magento 2 Configurable Swatches

Swatches allow you to display a selection of options for configurable products. Rather than using the drop-down list, shoppers can choose what they like by clicking a swatch.

We show the steps to configure color swatches in Magento 2.

Best Magento Hosting now

Types of Swatches in Magento 2

Visual Swatch

Color Swatch or Visual Swatch shows customers a variety of colors, patterns, or designs of the products. When the item is displayed in different colors, it makes it easier for a customer to choose the right product variation.

The color swatches are displayed in the following way:

Visual Swatch -Set up Magento 2 Configurable Swatches

Text-Based Swatch

Text-based Swatch -Set up Magento 2 Configurable Swatches

A text-based swatch is used to show product sizes or other text-based options. It is often displayed as a button with a text label. It works the same way as a visual or color swatch.

Image Swatch

The image swatch function enhances the visual components of your product offerings and product variations in different colors/textures.

Swatches in Layered Navigation

Magento 2 Swatches in Layered Navigation

The swatches such as color swatches and text-based swatches can be also used in the Layered Navigation section. You have to check if the Layered Navigation property of the color attribute is set to Yes.

Steps for Magento 2 Configurable Swatches

Use the following two methods to configure swatches in Magento 2.

1. Create the Swatches

Method 1: Add a Color Swatch

https://www.mgt-commerce.com/tutorials/

  • Get the exact color for your product.

  • Use the Admin sidebar, and navigate to Stores > Attributes > Product.

  • In the grid, you will find the Color attribute.

  • Set Catalog Input Type for Store Owner to Visual Swatch.

  • In the Manage Swatch section, click on Add Swatch to add a new definition to the list.

Set up Magento 2 Configurable Swatches

  • In the swatch menu, select Choose a color option. You will see a color picker section pop up.

Set up Magento 2 Configurable Swatches

  • In the color picker, use the # field and enter the six numbers that represent the hexadecimal value of the new color. Click on the Color Wheel button in the lower-right corner to save the swatch.

Set up Magento 2 Configurable Swatches

  • Add the label for the color in the Admin and Default Store View.

  • Select the checkbox under the Is Default to set the default color.

  • You can change the order by clicking on the Manage Swatch table.

  • Click on Save Attribute, and flush the cache in the Cache Management tab.

  • Navigate to Edit mode in each product. Update the Color attribute with the correct swatch.

Method 2: Upload a Swatch Image

Upload a Swatch Image

  • Choose the swatch images that are suitable for your product.

  • On the Admin sidebar, navigate to Stores > Attributes > Product.

  • In the grid, find and edit the Color attribute.

  • Set Catalog Input Type for Store Owner to Visual Swatch.

  • In the Manage Swatch section, click on Add Swatch to add a new definition.

  • On the swatch menu, select Upload a file. Choose the required image from your device. Repeat these steps for other swatch images.

Set up Magento 2 Configurable products

  • Add the label for the color in the Admin and Default Store View.

  • After the steps, click on Save Attribute and flush the cache in the Cache Management tab.

  • Navigate to the Edit mode in each product, and update the Color attribute with the correct swatch.

Update the Product

  • From the Admin sidebar, navigate to Products > Inventory > Catalog.

  • Filter the list by Name or SKU to include the applicable products.

Set up Magento 2 Configurable products

  • Mark the checkbox of each product that you want the swatch to apply. Select the Actions tab to Update Attributes.

Set up Magento 2 Configurable products

  • Look down to the Color attribute, and click on the Change checkbox. It will update the product preview image.

Set up Magento 2 Configurable products

Save the Product

Click on Save to apply the swatch. Flush the cache in the Cache Management tab to implement the changes.

Summary

Swatches make it easier for customers to choose product variations and improve online sales. The configurable swatches can be used on the product and category pages and in layered navigation.

We have covered the steps to configure color swatches in Magento 2.

Get more Magento 2 insights on MGT Commerce Tutorials.

Nikita S.
Nikita S.
Lead Technical Writer

As a lead technical writer, Nikita S. is experienced in crafting well-researched articles that simplify complex information and promote technical communication. She has expertise in cloud computing and holds a specialization in SEO and digital marketing.


Get the fastest Magento Hosting! Get Started