Magento 2: Display manufacturer on product view
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
add a comment |
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
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
add a comment |
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
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
magento2 product-view
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
hopefully it will work.
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
hopefully it will work.
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
add a comment |
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
hopefully it will work.
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
add a comment |
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
hopefully it will work.
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
hopefully it will work.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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