5/7/2015 - 8:04 PM

Display Custom Attributes in Magento Products

Display Custom Attributes in Magento Products

// reference:
// http://magento.stackexchange.com/questions/5057/magento-checkout-getting-custom-attribute-value

//if you are in product page, then for DROP-DOWN attribute simply add
echo $_product->getAttributeText('attribute_code');

//for TEXT attribute add
echo  $_product->getData('attribute_code');

//If you are not in product page then you have to load product by product id first.
$_product = Mage::getModel('catalog/product')->load($id); 


1)  create a new attribute

2) add it to manage attribute:

3) these new attributes will display below the product  description

4) then in your product detail template display these blocks 
echo  $_product->getData('attribute_code');

make sure you have access to $_product or $product:

$product_id = Mage::registry("current_product")->getId();
$product = Mage::getModel('catalog/product')->load($product_id);
  <div class="tab-content">
    <div id="hometab" class="tab-pane fade in active">
      <p><?php echo $tabcont;  ?></p>
    <div id="menu1" class="tab-pane fade">
      <p><?php  echo  $product->getData('specifications');   ?></p>
    <div id="menu2" class="tab-pane fade">
      <p><?php  echo  $product->getData('documents');   ?></p>
    <div id="menu3" class="tab-pane fade">
      <p><?php  echo  $product->getData('product_gallery');   ?></p>