jcadima
5/7/2015 - 8:04 PM

Display Custom Attributes in Magento Products

Display Custom Attributes in Magento Products

<?php
// 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); 

https://magento.stackexchange.com/questions/145772/how-to-get-attribute-values-for-products-in-magento-1-9

1)  create a new attribute
http://i.imgur.com/ScWDmBh.png


2) add it to manage attribute:
  http://i.imgur.com/oUHc3gs.png


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>
    <div id="menu1" class="tab-pane fade">
      <p><?php  echo  $product->getData('specifications');   ?></p>
    </div>
    <div id="menu2" class="tab-pane fade">
      <p><?php  echo  $product->getData('documents');   ?></p>
    </div>
    <div id="menu3" class="tab-pane fade">
      <p><?php  echo  $product->getData('product_gallery');   ?></p>
    </div>
  </div>