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
 
 
 
 Manish 
 
 2171 gold badge2 silver badges6 bronze badges
 
 1 Answer 1
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
 
 
 
 Msquare 
 
 9,4627 gold badges30 silver badges71 bronze badges
 
 Explore related questions
See similar questions with these tags.
default