0

I'm trying to add a custom tab that only shows when the product is a grouped product. Below is what I have so far in the local.xml file:

            <action method="addTab" translate="title" module="catalog"><alias>static_block_name</alias><title>Part Numbers</title><block>cms/block</block><template>null</template></action>
                            <!-- define the CMS block ID for the parts info tab -->
            <block type="cms/block" name="product.info.tabs.static_block_name" as="static_block_name">
                <action method="setBlockId"><block_id>parts</block_id></action>
            </block>

I tried to use this logic

<product_type_grouped>
<reference name="product.info">
    <!-- Static block -->

                <action method="addTab" translate="title" module="catalog"><alias>static_block_name</alias><title>Part Numbers</title><block>cms/block</block><template>null</template></action>
                                <!-- define the CMS block ID for the parts info tab -->
                <block type="cms/block" name="product.info.tabs.static_block_name" as="static_block_name">
                    <action method="setBlockId"><block_id>parts</block_id></action>
                </block>
</reference>

But that didn't work. Any ideas?

1 Answer 1

1

First, use the case-sensitive layout handle: PRODUCT_TYPE_grouped

Second, the "catalog/product_view" block class (what "product.info" is) does not have a method "addTab" (at least in default Magento). You need to reference the class that manages the tabs and see what interface it supports... in fact this is usually the role of the theme to group SPECIFIC child blocks into a tab interface and is not a Block class functionality.

Turn on template path hints to find out what phtml and Block is controlling the tabs and go backwards from there.

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.