Question

I recently added a 'tooltip description' column to an attribute. I used this following code

$fieldset->addField('tooltip', 'text', array(
    'name' => 'tooltip',
    'label' => Mage::helper('catalog')->__('Tooltip'),
    'title' => Mage::helper('catalog')->__('Tooltip')
));

to add a field in my app\code\core\Mage\Adminhtml\Block\Catalog\Product\Attribute\Edit\Tab\Main.php. This adds the extra field to the attribute-edit screen. I also added a column with type TEXT in the eav_attribute table to make sure the property gets saved when editing your attribute. And it worked perfectly in the backend. See the following Image:

tooltip attribute

Now I want to show the Tooltip Description value in frontend where the attributes value are shown....say in attributes.phtml page. So what is the code to dispaly it in frontend.

Was it helpful?

Solution

Try following

<?php 
foreach ($this->getAttributes() as $_attribute){ 
    echo $_attribute->getTooltip();
}
?>

UPDATE

$attribute_code = $_data['code']; 
$attribute_details = Mage::getSingleton("eav/config")->getAttribute('catalog_product', $attribute_code); 
$attribute = $attribute_details->getData(); // returns array 


echo "<pre>";
print_r($attribute);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top