Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - Echo Attribute on Product Page

Tags:

magento

In my Magento store I have created a new attribute with an attribute code of 'brand_info'.

How can I echo/print the contents of this attribute onto a product page ie. below the description?

like image 727
a1anm Avatar asked Jun 24 '10 12:06

a1anm


2 Answers

To display the contents of attribute on product page you need to add following code in view.phtml file.

$_product->getResource()->getAttribute('brand_info')->getFrontend()->getValue($_product);
like image 95
Swapna Taru Avatar answered Oct 05 '22 22:10

Swapna Taru


Make sure that the attribute is marked as "used in frontend", then in your template name write the following where you want to see the attribute:

<?php print $_product->getBrandInfo(); ?>
like image 42
Joe Mastey Avatar answered Oct 05 '22 21:10

Joe Mastey