Skip to content

Magento 2 Import Visual Swatch and Text Swatch Attribute Options Programatically

I have an attribute with attribute ID ‘color’. Which has options with visual swatches. and another attribute with ID ‘material’ which has options with Text swatches.

Now for the ‘color’ attribute I need to add options with swatch image or color code programatically. Also add the option labels stores wise.

For the ‘material’ attribute I need to add the option labels and description store wise.

Please give me some idea regarding this.