3

I want to know how to add new custom tab on the product view page. Like: Description, Tags, Reviews.
Please give me some suggestion how it will be possible .

3
  • do you have any theme using? – Shyam Krishna Sreekumar May 14 '15 at 6:01
  • yes i have use a magento theme – zaheen May 14 '15 at 6:01
  • Give some valuable views – zaheen May 14 '15 at 6:09
2

You need to add this in the layout xml file from one of your modules (or local.xml of your theme).

<catalog_product_view>
    <reference name="product_info">
        <block type="your_block/alias_here" name="some_name_here" as="some_alias_here" template="path/to/template.phtml">
            <action method="addToParentGroup"><group>detailed_info</group></action>
            <action method="setTitle" translate="value"><value>Tab Title Here</value></action>
        </block> 
    </reference>
</catalog_product_view>

Then create your block and the template with the content you need.

3
  • Custom tab showing but data not showing in the tab. – zaheen May 14 '15 at 7:05
  • that depends on how your tab block and template look like. I cannot guess what's wrong. You asked how to show a tab and I told you. The tab is shown. So problem solved. – Marius May 14 '15 at 7:11
  • This does work. Although I had to change product_info to product.info. – Paul Blundell Oct 3 '16 at 15:34
2

Go to /layout/local.xml search tab inside it. You can see something like this

<action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>

Duplicate it. Rename description to your desired one. Add corresponding support files in

catalog/product/view/yourname.phtml

and

 /code/core/Mage/Catalog/block/product/view/Yourname.php.

Also you need to change the content as well.

2
  • Custom tab showing but data not showing in the tab. – zaheen May 14 '15 at 7:05
  • what data you need to show? You didnt mentioned in first question.. – Shyam Krishna Sreekumar May 14 '15 at 7:06
0

There is a way to do it , by creating an attribute. Below i will provide you with a link that i believe it will make clear to you how to solve your problem.

Add Custom Tab

Check it out.

1
  • Welcome to SE. Single link answers are not the best answer. Please add to your answer at least the significant part of what's found at the end of that URL. – Marius May 14 '15 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.