Magento 2: Display manufacturer on product view












0















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="MagentoCatalogBlockProductViewAttributes" name="product.info.sidebarbrands" template="Magento_Catalog::product/view/sidebar-brand.phtml" after="product.info.main"/>
</container>


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/



https://stackoverflow.com/questions/37305107/how-do-i-display-an-attribute-on-product-view-page-in-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 advance.










share|improve this question

























  • Can you update your whole xml code and also the sidebar_brand.phtml codes?

    – Sukumar Gorai
    Oct 8 '18 at 14:23











  • After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set

    – M2newbie
    Oct 8 '18 at 16:01


















0















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="MagentoCatalogBlockProductViewAttributes" name="product.info.sidebarbrands" template="Magento_Catalog::product/view/sidebar-brand.phtml" after="product.info.main"/>
</container>


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/



https://stackoverflow.com/questions/37305107/how-do-i-display-an-attribute-on-product-view-page-in-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 advance.










share|improve this question

























  • Can you update your whole xml code and also the sidebar_brand.phtml codes?

    – Sukumar Gorai
    Oct 8 '18 at 14:23











  • After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set

    – M2newbie
    Oct 8 '18 at 16:01
















0












0








0








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="MagentoCatalogBlockProductViewAttributes" name="product.info.sidebarbrands" template="Magento_Catalog::product/view/sidebar-brand.phtml" after="product.info.main"/>
</container>


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/



https://stackoverflow.com/questions/37305107/how-do-i-display-an-attribute-on-product-view-page-in-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 advance.










share|improve this question
















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="MagentoCatalogBlockProductViewAttributes" name="product.info.sidebarbrands" template="Magento_Catalog::product/view/sidebar-brand.phtml" after="product.info.main"/>
</container>


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/



https://stackoverflow.com/questions/37305107/how-do-i-display-an-attribute-on-product-view-page-in-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 advance.







magento2 product-view






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 17 mins ago









Utsav Gupta

16213




16213










asked Oct 8 '18 at 14:22









M2newbieM2newbie

31




31













  • Can you update your whole xml code and also the sidebar_brand.phtml codes?

    – Sukumar Gorai
    Oct 8 '18 at 14:23











  • After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set

    – M2newbie
    Oct 8 '18 at 16:01





















  • Can you update your whole xml code and also the sidebar_brand.phtml codes?

    – Sukumar Gorai
    Oct 8 '18 at 14:23











  • After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set

    – M2newbie
    Oct 8 '18 at 16:01



















Can you update your whole xml code and also the sidebar_brand.phtml codes?

– Sukumar Gorai
Oct 8 '18 at 14:23





Can you update your whole xml code and also the sidebar_brand.phtml codes?

– Sukumar Gorai
Oct 8 '18 at 14:23













After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set

– M2newbie
Oct 8 '18 at 16:01







After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set

– M2newbie
Oct 8 '18 at 16:01












1 Answer
1






active

oldest

votes


















0














Your layout changes seem to fine ( and expecting .phtml changes fine too ) then only possible issue could be enabling storefrontend settings to view on catalog pages.



you need to check attribute front-end setting :




Stores->Attributes->Product




and find your manufacturer attribute ( click to edit ) and go to "Storefront Properties" ( as attached ) there you should change
Visible on Catalog Pages on Storefront to Yes



enter image description here



hopefully it will work.






share|improve this answer
























  • Hello, it was more simple then this. After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set. Might been working with Magento 1 too much! Thank you for your help.

    – M2newbie
    Oct 8 '18 at 16:00













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f245590%2fmagento-2-display-manufacturer-on-product-view%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Your layout changes seem to fine ( and expecting .phtml changes fine too ) then only possible issue could be enabling storefrontend settings to view on catalog pages.



you need to check attribute front-end setting :




Stores->Attributes->Product




and find your manufacturer attribute ( click to edit ) and go to "Storefront Properties" ( as attached ) there you should change
Visible on Catalog Pages on Storefront to Yes



enter image description here



hopefully it will work.






share|improve this answer
























  • Hello, it was more simple then this. After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set. Might been working with Magento 1 too much! Thank you for your help.

    – M2newbie
    Oct 8 '18 at 16:00


















0














Your layout changes seem to fine ( and expecting .phtml changes fine too ) then only possible issue could be enabling storefrontend settings to view on catalog pages.



you need to check attribute front-end setting :




Stores->Attributes->Product




and find your manufacturer attribute ( click to edit ) and go to "Storefront Properties" ( as attached ) there you should change
Visible on Catalog Pages on Storefront to Yes



enter image description here



hopefully it will work.






share|improve this answer
























  • Hello, it was more simple then this. After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set. Might been working with Magento 1 too much! Thank you for your help.

    – M2newbie
    Oct 8 '18 at 16:00
















0












0








0







Your layout changes seem to fine ( and expecting .phtml changes fine too ) then only possible issue could be enabling storefrontend settings to view on catalog pages.



you need to check attribute front-end setting :




Stores->Attributes->Product




and find your manufacturer attribute ( click to edit ) and go to "Storefront Properties" ( as attached ) there you should change
Visible on Catalog Pages on Storefront to Yes



enter image description here



hopefully it will work.






share|improve this answer













Your layout changes seem to fine ( and expecting .phtml changes fine too ) then only possible issue could be enabling storefrontend settings to view on catalog pages.



you need to check attribute front-end setting :




Stores->Attributes->Product




and find your manufacturer attribute ( click to edit ) and go to "Storefront Properties" ( as attached ) there you should change
Visible on Catalog Pages on Storefront to Yes



enter image description here



hopefully it will work.







share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 8 '18 at 15:15









Naveed AsimNaveed Asim

2,5362315




2,5362315













  • Hello, it was more simple then this. After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set. Might been working with Magento 1 too much! Thank you for your help.

    – M2newbie
    Oct 8 '18 at 16:00





















  • Hello, it was more simple then this. After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set. Might been working with Magento 1 too much! Thank you for your help.

    – M2newbie
    Oct 8 '18 at 16:00



















Hello, it was more simple then this. After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set. Might been working with Magento 1 too much! Thank you for your help.

– M2newbie
Oct 8 '18 at 16:00







Hello, it was more simple then this. After testing everything I now found out that the attribute Manufacturer was not active as default in the attribute set. Might been working with Magento 1 too much! Thank you for your help.

– M2newbie
Oct 8 '18 at 16:00




















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f245590%2fmagento-2-display-manufacturer-on-product-view%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Polycentropodidae

Magento 2 Error message: Invalid state change requested

Paulmy