0

I am using a theme called GalaElectronics I believe. I am looking to change the default select tab when the product is viewed. Currently it displays Description first and its on the left, I need it to display features first and have it on the left instead. What do I have to modify to accomplish this. enter image description here

1
  • Leaving open for now, but this can likely be solved on StackOverflow.
    – benmarks
    Jan 8, 2014 at 15:05

2 Answers 2

1

In catalog.xml file of your theme you can see a block named product.info.tabs:

<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
                    <action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog"><alias>upsell_products</alias><title>We Also Recommend</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>
                </block>

This one is from the default modern theme. If you required a tab to position ahead of another for example in above code if , upsell needs to be before description then, you can move the upsell addTab method before description to get that effect:

<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
                    <action method="addTab" translate="title" module="catalog"><alias>upsell_products</alias><title>We Also Recommend</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>
                </block>
0

I am not sure about the theme you are using but in general for any tab structure, To make it active there will be an active class in there[Name may be different for class you have to check it first either going into file structure or using firebug]. The change you have to make is add an active class on the tab you want to make active.

Alternatively you can also do it using jQuery. You just note the id of both tab if there are and add a jQuery something like this

jQuery(document).ready(function(){
    jQuery("#tab1").removeClass('active');
    jQuery("#tab2").addClass('active');
})

If you dont know the id of tab you can also manage is using index. The code should look something like this

jQuery(document).ready(function(){
        jQuery(".className").eq(0).removeClass('active');
        jQuery(".className").eq(1).addClass('active');
    })

Here .className is the name of the common class in tab. and #tab1, #tab2 are the id's of the tab

2
  • I got it working but now my issue is that I need to make the Features appear on the left and the description on the right. I have been trying for hours with no luck so far. Jan 8, 2014 at 4:27
  • i am not sure how the tab structure works. But you can check the catalog.xml or local.xml to check if they have called the tabs over there. You can also check in tab file. They have been usng $this->getDescription() for calling description you just have to rearrange them
    – Dexter
    Jan 8, 2014 at 6:11

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.