嵌入式Widget Yotpo bigcommerce

时间:2015-04-23 06:46:12

标签: widget embedded bigcommerce

有人可以帮我解释为什么我的嵌入式小部件没有出现在我的yotpo应用程序上吗?我正在使用大型商务平台。我已经尝试一遍又一遍地卸载和安装它,但结果仍然相同。

1 个答案:

答案 0 :(得分:0)

禁用内置评论。 Settings > Comments > Built-in 取消选中“产品评论”复选框,然后保存。

安装Yotpo社交评论小部件:

登录您的Bigcommerce管理页面。

  • 点击“设置”。
  • 单击“商店设置”列中的“设计”。
  • 点击修改HTML / CSS。
  • 单击“其他模板文件 - 面板”下的“ProductDetails.html”。
  • 在文件的最后一行之后添加以下代码。

    <script type="text/javascript">
    //<![CDATA[
    var div = document.createElement("div");
    div.setAttribute('class', 'yotpo yotpo-main-widget');
    div.setAttribute('data-product-id', "%%GLOBAL_ProductId%%");
    div.setAttribute('data-name', "%%GLOBAL_ProductName%%");
    div.setAttribute('data-url', document.URL);
    div.setAttribute('data-description', "");
    div.setAttribute('data-image-url', "%%GLOBAL_ThumbImageURL%%");
    if ($(".yotpo.placeholder").length) {
      $(".yotpo.placeholder").append(div);
    } else {
      $("#ProductDescription").append(div);
    }
    //]]>
    </script>    
    

    ProductDetails

  • 将以下Yotpo JavaScript代码直接添加到HTMLHead.html。

  • 转到设计&gt;编辑HTML / CSS并查找HTMLHead.html。
  • 在文件的最后一行之后,在</head>上方添加以下代码。

    <script type="text/javascript">
    (function e() {
    var e = document.createElement("script");
    e.type = "text/javascript", e.async = true, e.src = "//staticw2.yotpo.com/YOUR-APP_KEY/widget.js";
    var t = document.getElementsByTagName("script")[0];
    t.parentNode.insertBefore(e, t)
    })();
    </script>
    

HTMLHead

不要忘记用钥匙替换YOUR-APP_KEY。