MINAKSHEE AWARI
MINAKSHEE AWARI

Reputation: 21

how to display custom attribute on product view page in magento 1.9?

I created one attribute "gmdn" on Magento and put it in attribute set default. But after I gave a value to this attribute, it is displayed in the additional information tab. But I want to display it below the name of product in the view page.

Upvotes: 0

Views: 2549

Answers (2)

For example, Your attribute code is gmdn, You need to do the following things at /app/design/frontend/[your package]/[your theme]/template/catalog/product/view.phtml:

1) <?php
    $gmdn = $this->htmlEscape($_product->getData('gmdn'));    
    echo $gmdn;    
?>

Or

2) echo $this->htmlEscape($_product->getData('gmdn')); 

These two are same. But representing way is diferent.

Upvotes: 1

Piyush
Piyush

Reputation: 455

For this you have to make changes in file

app/design/frontend/your_package/your_theme/template/catalog/product/view.phtml

and add below code after product name division

<?php echo $_product->getGmdn() ?>

Upvotes: 1

Related Questions