Skip to content Skip to sidebar Skip to footer
Reading Time: 2 minutes

This article is describing easy & best way to add/show custom attribute to product details page correctly.follow the step by step guideline through the article below.
I’m using Magento 1.9

1-Create a new attribute from admin panel.

Catalog -> Attributes -> Manage Attributes
-I’m creating “product_specifications” as the attribute code.
-Make sure the value Yes for “Visible on Product View Page on Front-end”
-Scope- Global , Catalog Input Type for Store Owner-Text Area
-Assign this attribute to the “Attribute Set”.
Magento add custom attribute to product details page-3

2-Edit layout files

Method -1 (catalog.xml)

1- Go here:- app/design/frontend/yourtheme/layout/catalog.xml
Find the following code.

detailed_info

 

2-Add the following code after the above code.

       
detailed_info
Specifications

Magento add custom attribute to product details page

3-Save the file.


Method -2 (local.xml)

1- Go here:- app/design/frontend/yourtheme/layout/local.xml
2-Add the following code after the above code.

              
detailed_info                
Product Details                   

Magento add custom attribute to product details page-2

3-Save the file.

3-Create template file

1-Create a new file app/design/frontend/yourtheme/template/catalog/product/view/productspecifications.phtml
2-Add this code there and save the file.

//echo $_product->getData('product_specifications'); 
$_proId= Mage::registry('current_product')->getId(); 
$_product= Mage::getModel('catalog/product')->load($_proId); 
$CustomAttribute= $_product->getData('product_specifications'); 
echo $CustomAttribute; 

NOTE:- Go the the magento cache and clear the cache. Also clear the browser cache.
-Now add a product under specific attribute set.
You can see the added attribute there.
Magento add custom attribute to product details page-4
Go to the frontend then you can see it.
Magento add custom attribute to product details page-5
Leave the comment below for further discussions.
Thanks