Magento直接链接到产品选项卡 [英] Magento Direct Link to product tab

查看:74
本文介绍了Magento直接链接到产品选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以直接链接到产品标签?

is it possible to Link direct to product tabs?

喜欢

mysite.com/onclick =转到tab3

mysite.com/ onclick=go to tab3

推荐答案

不幸的是,没有一些编码.这些选项卡是ul列表中的元素.您可以做的是一个JavaScript代码段,该代码段检查给定的请求参数并触发特定选项卡链接上的click事件.

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> 

...,然后Chrome检查工具将显示带有以下内容的第一个标签页眉:

...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));

},

因此,我将通过在Javascript中查找request参数并触发该li-元素链接的click事件来解决该问题.

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.

这篇关于Magento直接链接到产品选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆