1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Magento 2: Display manufacturer on product view

Discussion in 'Programming/Internet' started by M2newbie, Oct 8, 2018.

  1. M2newbie

    M2newbie Guest

    I have my custom "sidebar_brand.phtml" in "catalog_product_view.xml".

    <container name="right.product.container" as="rightProductContainer" label="Right Product Container" htmlTag="div" htmlClass="col-md-3 text-sm-center" >
    <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.info.sidebarbrands" template="Magento_Catalog::product/view/sidebar-brand.phtml" after="product.info.main"/>

    I have tried many different ways but I can not find out how to display the manufacturer attribute in this file.

    Should I do it from the xml file, or the phtml file?

    I have seen different solutions, but nothing works. I am using Magento 2.2.3, how do I get the '$_product->getAttributeText('manufacturer');' working?

    Sources: https://www.dckap.com/blog/display-custom-attribute-value-product-viewlist-page-magento-2/


    I am failing all the time! Can someone please show me how it should be in my Magento version?

    The phtml file sidebar_brand.phtml works fine, but I am not able to show the product attribute.

    Thank you in advanced.

    Login To add answer/comment

Share This Page