How to Configure Swatches in Magento 2

Go to Stores – Attributes – Product and click on the Color Attribute option.

Color swatch configuration in Magento2
Color swatch configuration in Magento2

From here, you can configure all the available color swatch settings:

  • Catalog Input Type for Store Owner — allows you to define the input type. You can select from the Dropdown Menu, Visual Swatch and Text Swatch.
  • Update Product Preview Image — updates the product image on the catalog page when filtered by this attribute.
  • Use Product Image for Swatch if Possible — allows replacing a swatch image with a product swatch or a base image.

When done, move to the Manage Swatch (Values of Your Attribute) section.

Configure color swatch in Magento 2

Click on the Add Swatch button to set the values for the selected attribute. If you’ve chosen a color swatch, then you can add the colors you need and fill in the text descriptions. Also, you can replace colors with images. Hit the arrow near the color box and hit the Upload a file button.

Please note, for a text swatch you can define values only as text. The easiest variant is to use a dropdown type with the text description values.

How to Assign Attributes to the Products

When all the configuration steps are done, you need to assign attributes to the products. Go to Products – Catalog, select a product you want to attach an attribute to and hit the Update Attributes option from the Actions drop-down. In the ‘Color tab’ change the attribute for the necessary one.

Configuring Image swatch in magento 2

Leave a comment

Your email address will not be published. Required fields are marked *