I have created a counfigurable product with. New Attribute Set & it's attributes. I have set the value in Admin also.
On vendor\magento\module-catalog\view\frontend\templates\product\list.phtml
I'm customizing listing. I'm trying to get my newly added attribute using
foreach ($_productCollection as $_product):
echo $_helper->productAttribute($_product, $_product->getYear(), 'year');
$attribute = $_product->getResource()->getAttribute('year');
if ($attribute) {
echo $labelValue = $attribute->getFrontend()->getValue($_product);
}
endforeach;
But it's still not displaying set value. I'm able to see value in Admin Product Page. But not in the frontend.
I have cleared cache as well.