jon
jon

Reputation: 387

Magento Direct Link to product tab

is it possible to Link direct to product tabs?

like

mysite.com/ onclick=go to tab3

etc

Upvotes: 0

Views: 2234

Answers (2)

rbncha
rbncha

Reputation: 922

I know this is an old question. However, someone might be looking for the simple built in solution.

You can simply give the id of the tab in url (like in product add/edit page). Exmaple below:

http://yoururl.com/admin/catalog_product/edit/tab/product_info_tabs_inventory/id/259/

Upvotes: 1

Sven
Sven

Reputation: 952

Unfortunately not without some coding. The tabs are li-elements in a ul-list. What you could do is a javascript snippet that checks for a given request parameter and trigger a click event on the particular tab link.

This is a part of the modern theme demo store:

<ul class="product-tabs"> 
                    <li id="product_tabs_description" class=" active first"><a href="#">Product Description</a></li> 
                            <li id="product_tabs_upsell_products" class=""><a href="#">We Also Recommend</a></li> 
                            <li id="product_tabs_additional" class=""><a href="#">Additional Information</a></li> 
                                        <li id="product_tabs_product.tags" class=" last"><a href="#">Product Tags</a></li> 
        </ul> 

...and the Chrome inspection tool will show the first tab header with:

<a href="javascript:void(0)">Product Description</a>

...that will run this code:

initTab: function(el) {
  el.href = 'javascript:void(0)';
  if ($(el.parentNode).hasClassName('active')) {
    this.showContent(el);
  }
  el.observe('click', this.showContent.bind(this, el));

},

So, I would solve it by looking for the request parameter in a Javascript and the trigger a click event for that li-element link.

Upvotes: 2

Related Questions