3

How do you change the order of the tabs on the product details page.

I created a new tab called 'Programs' by adding the below to my local.xml

<catalog_product_view translate="label">
    <reference name="product.info">
        <block type="catalog/product_view_description" name="product.programs" as="programs" template="catalog/product/view/programs.phtml">
            <action method="addToParentGroup"><group>detailed_info</group></action>
            <action method="setTitle" translate="value"><value>Programs</value></action>
        </block>
    </reference>
</catalog_product_view>

I aslo created a catalog/product/view/programs.phtml template in my theme.

In addition I created another tab called ingredients

Now I have 3 tabs on my product details page i.e. Description, Reviews, Programs & Ingredients.

How can I change the order to Programs Description Ingredients and Reviews?

Also, how can I link my the templates I created for these new tabs to a product attribute?

5

Use the before or after tag in your block. Here is an official guide to achieve that.

Example:

 <block type="cms/block" before="some-other-block" name="left.permanent.callout">
  • Cool. Remember to mark the question as resolved. – mbalparda Jul 30 '14 at 15:33
  • Do you know how I can link my the templates I created for these new tabs to a product attribute? – Holly Jul 30 '14 at 15:33
  • Make another question for that please. – mbalparda Jul 30 '14 at 15:34
0

I have also similar requirement, I have Specifications and Description tabs and I have to swap their positions on the product details page.
Therefore in the catalog.xml, I have changed the below code

<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
                    <action method="addToParentGroup"><group>detailed_info</group></action>
                    <action method="setTitle" translate="value"><value>Specifications</value></action>
                </block>
                <block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
                    <action method="addToParentGroup"><group>detailed_info</group></action>
                    <action method="setTitle" translate="value"><value>Description</value></action>
                </block>

to

<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
                    <action method="addToParentGroup"><group>detailed_info</group></action>
                    <action method="setTitle" translate="value"><value>Specifications</value></action>
                </block>
                <block type="catalog/product_view_description" after="product.attributes" name="product.description" as="description" template="catalog/product/view/description.phtml">
                    <action method="addToParentGroup"><group>detailed_info</group></action>
                    <action method="setTitle" translate="value"><value>Description</value></action>
                </block>

Basically, I have added the after attribute in the block tag.

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.