0

I am trying to get admin value in multiselect but I am not able to get this can anybody suggest?enter image description here

1 Answer 1

0

Try This Code

protected $eavData;

public function __construct(
    ...............................................
    \Magento\Eav\Model\Config $eavData,
    ...............................................
) {
    ...............................................
    $this->eavData = $eavData;
    ...............................................
}

...............................................
...............................................

public function getAdminValue()
{
    echo "<pre>";
    $attribute = $this->eavData->getAttribute('catalog_product', 'Your Attribute Code Here')->setStoreId(0);
    $options = $attribute->getSource()->getAllOptions();
    foreach ($options as $existingOption) {
        echo $existingOption['label']."<br/>";
    }
    echo "</pre>";
    exit();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.