3

I'm using default RWD theme. I'm trying to add my static block in product page between additional information tab and product reviews tab.static block in product page between additional information tab and product reviews tab

I tried to add something like this in my local.xml file but it doesn't work:

<catalog_product_view>
    <reference name="product.info">
      <block type="cms/block" name="my_block_name" before="reviews">
        <action method="setBlockId"><id>my_block_name</id></action>
      </block>
    </reference>
</catalog_product_view>
7

If you have a lok at how the review tab has been added in review.xml of the rwd theme, you find:

<catalog_product_view>
    <reference name="product.info">
        <block type="review/product_view_list" name="product.reviews" as="reviews" template="review/product/view/list.phtml" after="additional">
            <action method="addToParentGroup"><group>detailed_info</group></action>
            <action method="setTitle" translate="value"><value>Reviews</value></action>
        </block>
    </reference>
</catalog_product_view>

You can use the same method to add any other block as a tab in your own module (or local.xml of your theme). For a static block, it can look like this:

<catalog_product_view>
    <reference name="product.info">
        <block type="cms/block" name="product.whatever" as="whatever" after="additional">
            <action method="addToParentGroup"><group>detailed_info</group></action>
            <action method="setTitle" translate="value"><value>Whatever</value></action>
            <action method="setBlockId"><id>my_whatever_block_id</id></action>
        </block>
    </reference>
</catalog_product_view>

after="additional" will move it before the reviews tab because the core modules are always loaded first.

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.