How to get product’s attribute of Magento 2, like size, color
You can use getData method to retrieve the attribute’s value of Magento 2 product
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $_product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id); $_product->getData('attr_code');