Skip to main content
deleted 4 characters in body; edited title
Source Link

Magento 2  : New Product Attributes are not diplayingdisplaying on frontend

Magento 2  : New Product Attributes are not diplayingdisplaying on frontend

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.

Magento 2: New Product Attributes are not diplaying on frontend

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.

Magento 2  : New Product Attributes are not displaying on frontend

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.

Source Link
Jackson
  • 10k
  • 31
  • 131
  • 217

Magento 2: New Product Attributes are not diplaying on frontend

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.