开发者

Magento Direct Link to product tab

is it possible to Link direct to product t开发者_JS百科abs?

like

mysite.com/ onclick=go to tab3

etc


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.


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/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜