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

Rama Chandran M
3,26515 gold badges24 silver badges38 bronze badges
asked Jan 12, 2022 at 10:17

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();
}
answered Feb 11, 2022 at 7:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.