Magento 2 I am programmatically adding text swatch options but label is not getting displayed. enter image description here

I have referred links where many such issues are mentioned faced by different people

Magento 2 : How to save swatch_text attribute options programatically?

Can someone guide me know how to solve this issue?

Following is the code I have used?

  $attributeDetails = $objectManager->create('MagentoEavModelConfig')->getAttribute("catalog_product", $attributeCode);
    //print_r($attributeDetails->getId()); exit();
    $attributeId = $attributeDetails->getId();
    /* @var $attr MagentoEavModelEntityAttribute */
    $attr = $objectManager->create('MagentoEavModelEntityAttribute'); 
    $option = [];
    $option['value'][$languageValues[0]] = $languageValues;
    $attr->addData(array('option' => $option));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.