开发者

Facebook 'Like' button on an ecommerce site

I'm looking to add the 'Like' button on my ecommerce site. The problem I'm facing is figuring out how to have each individual page have its own Like accessibility. Meaning, if a user clicks on Like for one indiv开发者_开发问答idual product, I don't want the Like to show up for other products. It should be on a per product basis.

How does one configure the Like button in this case, to individualize each item with its own Likes?

Do I need to use FBML or can it be done with the iframe embed?


Yes it can be done with FB iframe code, you just need to write in the unique URL for each product into the code for each page.

So you need to assemble:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.example.com/UNIQUE-URL" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe>

where example.com is replaced with your site and UNIQUE-URL is replaced with the URL for that product. So your page template would use something like:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.example.com/products.php?pid=<?php print $pid ?>" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜