Image attribute filters
Create new product attribute
- On the Admin sidebar, tap Stores. Then under Attributes, choose Product.
- Create new ‘brand’ attribute.
- Set Catalog Input Type for Store Owner is set to “Visual Swatch.”
- Under Manage Swatch (values of your attribute), tap Add Swatch. Then, do the following:
- In the Swatch column, tap the new swatch to display the menu. Then, choose Upload a file.
Upload a File
- Navigate to the swatch file that you prepared, and choose the file to upload.
- Repeat these steps for each swatch image.
- Enter the labels for the Admin and Storefront.
- In the Storefront Proporties, set value ‘Filtrable (with results)’ for ‘Use in Layered Navigation’ .
- When complete, tap Save Attribute. Then when prompted, refresh the cache.
- The last step is to open each product in Edit mode, and update the brand attribute with the correct swatch. To update multiple products at the same time, follow the steps below.
- Run bin/magento index:reindex and bin/magento cache:flush