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?

1

2 Answers 2

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"> 
3
  • Cool. Remember to mark the question as resolved. Commented Jul 30, 2014 at 15:33
  • Do you know how I can link my the templates I created for these new tabs to a product attribute? Commented Jul 30, 2014 at 15:33
  • Make another question for that please. Commented Jul 30, 2014 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.