2

I've to add a new tab on product page and show some content from static block. Inside catalog.xml, I'm adding following code

<block type="catalog/product_view_attributes" name="product.info.details.shipping" as="product.info.details.shipping" template="catalog/product/view/tabs/additional.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
<action method="setTitle" translate="value"><value>Shipping</value></action>
</block>

Which is working fine to show the tab aand content from additional.phtml. When I change block type to cms/block, it doesn't work. What is the proper way to add a new tab and show some content from static block there?

If I've to show content from static block, in that case also I need to create templates and write code there to print static blocks content?

1 Answer 1

2

You need to add the method setBlockId and add the static block Identifier.

This code below was tested on Magento 1.9

<catalog_product_view>
    <reference name="product.info">
        <block type="cms/block" name="tab.new">
            <action method="addToParentGroup">
                <group>detailed_info</group>
            </action>
            <action method="setTitle" translate="value">
                <value>New Tab</value>
            </action>
            <action method="setBlockId">
                <block_id>static-block-id</block_id>
            </action>
        </block>
    </reference>
</catalog_product_view>

enter image description here

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.