Add Custom Product Tab In Magento and get Attribute Content

Posted: April 11, 2015 in Magento2

Add Custom Product Tab In Magento and get Attribute Content

Magento First

Navigate to Catalog > Attributes > Manage Attributes and click on Add New Attribute. Enter an attribute code “warranty” and be sure to specify Text Area for the textarea option. Fill in the remaining details to your preference.

The Code

In your theme’s design path, open the catalog.xml file. We’re going to add a custom tab, in my case a Warranty text, to appear immediately after the Additional Information tab. Second, locate the code for the Additional Information tab, which looks like this:


<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
     <action method="addToParentGroup"><group>detailed_info</group></action>
     <action method="setTitle" translate="value"><value>Additional Information</value></action>

Add your Code

<block type="catalog/product_view_attributes" name="product.warranty" as="warranty" template="catalog/product/view/warranty.phtml">
      <action method="addToParentGroup"><group>detailed_info</group></action>
      <action method="setTitle" translate="value"><value>Warranty</value></action>

Now we need to create the custom view at catalog/product/view/warranty.phtml to perform the logic. You might want to get more creative with your names!


$_product = $this->getProduct();
$attribute = $_product->getResource()->getAttribute('warranty');
if ( is_object($attribute) ) {
  $identifier = $_product->getData("warranty");
  echo $identifier;

Please see below Demo :


  1. You are a very capable individual!

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s