Magento add custom attribute to product details page

0

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.

2-Add the following code after the above code.

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.

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.

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

Share.

About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.