Bhaveshpp

Professional Magento Developr - Healp eachother to grow

Magento2: How to get frontend value of product attribute?

27 May 2021 » magento2, product, attribute

Get frontend attribute value

 
  $etat = $_product->getResource()->getAttribute('etat')->getFrontend()->getValue($_product); 
  

When return Magento\Framework\Phrase Object then use this

 
  $etat = $_product->getResource()->getAttribute('etat')->getFrontend()->getValue($_product)->getText();