Skip to main content
2 of 3
added 11 characters in body
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184

Magento 2, add Custom Text Attribute to the Products

i add a Custom TEXT Attribute (more_info) to my Magento 2 Store and i will show the Value to my product.info.main Page.

I add

mytheme\Magento_Catalog\layout\catalog_product_view.xml
<referenceBlock name="product.info.main">
    <block class="Magento\Catalog\Block\Product\View" template="product/view/more_info.phtml" >
    </block>
</referenceBlock>

and

mytheme\Magento_Catalog\templates\product\view\more_info.phtml

<?php $_product = $this->getProduct(); ?>
    <?php echo $_product->getAttributeText('more_info') ?>

but they show me no value :-(

Im very thankful for any help.