I have created a custom tab. I want to show different content in this custom tab.

If product type is simple show simple product

If product type is virtual show virtual product

How can i achieve this?

  • Please post some code with your question of what you have done so far to add the tab to make it easier for us to answer the question Feb 26, 2015 at 12:38

2 Answers 2


If it is on a productpage, you can add it in a local.xml

<PRODUCT_TYPE_simple> or <PRODUCT_TYPE_configurable>

or you could

$product = $this->getProduct() ? $this->getProduct() : Mage::registry('current_product');

if ($product->getTypeId() === 'simple') {
    // do something
} elseif ($product->getTypeId() === 'configurable') {
    // do something else

mkgarg,You can don this by layout handler.When a product page is rendered the magento create a dynamic handler using below code:$update->addHandle('PRODUCT_TYPE_' . $product->getTypeId());

So ,on simple product page,magento is called layout handler PRODUCT_TYPE_simple

and on virtual product page,magento is called layout handler PRODUCT_TYPE_virtual.

In default catalog.xml file you can see lot work depends on product type:

<PRODUCT_TYPE_simple translate="label" module="catalog">
    <label>Catalog Product View (Simple)</label>
<PRODUCT_TYPE_configurable translate="label" module="catalog">
    <label>Catalog Product View (Configurable)</label>
    <reference name="product.info">
       ......      </reference>
    <reference name="product.info.options.wrapper">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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