1

I can use the method addAttributeOption() from Magento\Eav\Setup\EavSetup to add options to a dropdown attribute, something like this:

$this->getCategorySetup()->addAttributeOption(
    [
        'attribute_id'  => $this->getAttribute($attributeCode)->getAttributeId(),
        'order'         => [0],
        'value'         => [
            [
                0 => $label
            ],
        ],
    ]
);

Now, how can I add an attribute option to a text swatch, including its swatch label?

Using Magento 2.1

  • Have you found a solution for this? – medina Aug 30 '16 at 7:19

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.