28 August

Adding your own tab in your product view pages

: 0 Comments

Need to add a tab in your product view page?, simple:

1) Open up app/design/frontend/default/yourtheme/layout/catalog.xml

2) Find this block call:

<block type=”catalog/product_view_tabs” name=”product.info.tabs” as=”info_tabs” template=”catalog/product/view/tabs.phtml” >

3) Add a line inside this block to call your tab, for example:

<action method=”addTab” translate=”title” module=”catalog”><alias>mytab</alias><title>My Tab</title><block>tag/product_list</block><template>catalog/product/mytab.phtml</template></action>

Where <title> is your tab name, and <template> is the path where your tab phtml file will be located. This .phtml file will display the content you want.

4) Once you’ve added this line, add your template .phtml file in the path you specified before, in this case would be: app/design/frontend/default/yourtheme/template/catalog/product/mytab.phtml

5) As a test, i’ve added the following line as the content of mytab.phtml file:

<div>
<?php echo “This is My Tab!”; ?>
</div>

This will display “This is My Tab!” as the tab content, but you can add there whatever you want, like a static-block call, videos, etc, etc.

Finally we have our own tab!:

mytab

Cheers! ;)

This post is also available in: Spanish

Back to Top