i need to add text swatch attribute value through script. I’am able to add the attribute but swatch value is not adding. Below is the code i using –
$attributeDetails = $objectManager->create('MagentoEavModelConfig')->getAttribute("catalog_product", $attributeCode);
//print_r($attributeDetails->getId()); exit();
$attributeId = $attributeDetails->getId();
$languageValues[0]=$label;
$languageValues[1]=$label;
/* @var $attr MagentoEavModelEntityAttribute */
$attr = $objectManager->create('MagentoEavModelEntityAttribute');
$attr->load($attributeId);
$option = [];
$option['value'][$languageValues[0]] = $languageValues;
$attr->addData(array('option' => $option));
$attr->save();
Here in image test is the value i am trying to create.
Any idea how to do it? Any help would be appreciated. Thanks in advance.