How can I get Magento 2 attribute label based on the Magento 2 attribute value
You need to load Magento 2 product and then get attribute label from the product’s object.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($product_id); $_product->getResource()->getAttribute('your_attribute_code')->getFrontend()->getValue($_product);