1

How can I get the Admin attribute label as shown in the pics?

I can get the frontend store label for each store view in this way:

$attribute = $_item->getResource()->getAttribute('format');                                
$attr_value = $attribute->getFrontend()->getValue($_item);

but I don't know how I can get the Admin label. Any solutions?

enter image description here

4
  • you means you get attribute values ??? If Yes, First you write attribute code $_product->getAttributeText('material'); and get attribute value like $result = $_product->getResource()->getAttribute('material')->getFrontend()->getValue($_product); Commented Jul 9, 2020 at 18:13
  • Hi, no. I mean the Admin attribute value, not the frontend attribute value (English or Italian in my case).
    – KaMZaTa
    Commented Jul 9, 2020 at 18:23
  • Please check this link --- magento.stackexchange.com/a/241999/85907 Commented Jul 9, 2020 at 18:27
  • Thanks but how should I get the admin attribute value from the product ($_item in my case)?
    – KaMZaTa
    Commented Jul 9, 2020 at 23:45

1 Answer 1

0

It can be done this way:

$product->getResource()->getAttribute('attribute_code')->setStoreId(0)->getFrontend()->getValue($product);

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.