在网站的每个产品上添加Facebook计数按钮 [英] Add Facebook Count Button On Each Products of a Website

查看:53
本文介绍了在网站的每个产品上添加Facebook计数按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Gud早上好,

我想将带有计数的Facebook按钮添加到具有产品的电子商务网站中.

我是Facebook集成人员的新手,请帮忙:)

谢谢与问候
Harsha

解决方案

这是标准的Facebook recomend-botton:

 <   div     id   ="  span> >  <  /div  > 
<  脚本 > (函数(d,s,id){
   var  js,fjs = d.getElementsByTagName(s)[ 0 ];
  如果(d.getElementById(id))返回;
  js = d.createElement(s); js.id = id;
  js.src = " ;
  fjs.parentNode.insertBefore(js,fjs);
}(文档' 脚本''  facebook-jssdk'));
<  / 脚本 >  



并将此html放在您想要按钮的位置:

 <   div      ="   数据参考  ="  http://www.myshop.com/products/123" 数据发送  ="    数据宽度  ="     data-show-faces   ="  false" 数据操作  ="  >  <  /div  >  


在每个产品页面上唯一需要更改的是fex product-id.如您所见,div标签(位于底部)包含一个属性"data-href"(每个产品的永久链接).当您按下喜欢"按钮时,这是喜欢"的唯一网址.



http://developers.facebook.com/docs/reference/plugins/like/ [ ^ ]


Hello Gud Morning All,

I want to add facebook button with counts showing into a ecommerce website which has products.

I am new to facebook integration guys please help out :)

Thanks and Regards
Harsha

解决方案

This is standard facebook recomend-botton:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>



And place this html where you want your button:

<div class="fb-like" data-href="http://www.myshop.com/products/123" data-send="false" data-width="450" data-show-faces="false" data-action="recommend"></div>


The onlye thing you should change on every productpage is fex the product-id. As you can see the div-tag (at bottom) contains an attribute "data-href" (permanent link to each product). This is the unique url to "like" when you hit the like-button.



http://developers.facebook.com/docs/reference/plugins/like/[^]


这篇关于在网站的每个产品上添加Facebook计数按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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