Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   Facebook "like" button in product detail page (/showthread.php?t=4246)

charlesk March 29th, 2011 02:14 PM

Facebook "like" button in product detail page

is it possible to add to the products detail page the Facebook "like" button, so that when the user "likes" it, then he posts on his wall that he likes this product (linking to my product detail page)?

Kind regards

Eric March 29th, 2011 02:28 PM

Hi Charles

I don't see why it wouldn't be possible but I've never used the "Like" button so I have no idea how to add it to a site.


charlesk April 1st, 2011 12:02 PM

I've done some experimenting with pasting the like button code in the text area in the product details view and this is what I noticed:

1) When pasting this:

<script src=""></script><fb:like href="" show_faces="false" width="450" font="arial"></fb:like>

The button appears under each product but clicking it makes you "like" the whole store, not the particular product.

2) Pasting this:

<iframe src="<?php echo store_link('dfrp=' . $dfr_product_id); ?>"
scrolling="no" frameborder="0"
style="border:none; width:auto; height:24px;"></iframe>

totally destroys the layout.

3) Pasting this:

<iframe src=""""
scrolling="no" frameborder="0"
style="border:none; width:auto; height:24px;"></iframe>

creates the like button, but with an url error.


Thoughts - the iframe seems to be the good way, but I have now idea how to write the permalink in the "href" section. Any ideas?

Eric April 1st, 2011 12:06 PM

You could try this:

<script src=""></script><fb:like href="[server.url type='fullpage']" show_faces="false" width="450" font="arial"></fb:like>

charlesk April 1st, 2011 12:14 PM

Same thing - it make the user "like" the store in general, not the particular product.

I've found a code for a Zen cart store that works on individual products, maybe it;s possible just to replace their permalinks with datafeedr's?


<iframe src="<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath= '.$_GET['cPath'].' &products_id=' . (int)$_GET['products_id'])); ?>"
 scrolling="no" frameborder="0"
 style="border:none; width:auto; height:24px;"></iframe>

Eric April 1st, 2011 12:21 PM

It looks like the correct parameters are being passed to FB. Here's the source code:
HTML Code:

<script src=""></script>
        class="fb_edge_widget_with_comment fb_iframe_widget"

        title="Like this content on Facebook."
        style="border: medium none; overflow: hidden; height: 23px; width: 450px;"


Are you sure that you are not dealing with a caching issue. FB relies on heavy caching.

I can't test the like button as I don't have a FB account.


euroads May 26th, 2011 08:37 AM

You need to need to add some facebook meta tags in your header in order to display the right information and pictures in your like post.

How do I get the datafeedr product tags to work in the header?

<meta property="og:site_name" content="mywebsite" />
<meta property="og:title" content="[]"/>
<meta property="og:image" content="[product.image]"/>
<meta property="og:description" content="[product.description cut='255 chars']"/>

euroads May 26th, 2011 09:02 AM

Nevermind:), I can added it under View > View <head> Elements.

And you need to add [product.image direct='1' tag='0'] instead of [product.image]

tblogster May 28th, 2011 02:39 PM

what effect did this have exactly?

GadgetStylist November 25th, 2011 09:17 AM

Did you guys figure our a solution to this in the end? I'm very keen to add social liking to my store - this is becoming as important as SEO to driving traffic and engagement.

My previous employers were making 20 times higher revenue per visit from Facebook referral traffic than SEO so it would be good to build this into the store along with Twitter and +1.

GadgetStylist November 25th, 2011 09:37 AM

I used this debug tool to try and figure on what's happening.

Looks like the rel canonical is pointing Facebook back at the home page of my store rather than pulling OG data from my page.

Any thoughts on how to fix this?

roelkers January 8th, 2012 05:18 PM

Howdy folks. Anyone able to get Facebook Like working.

Have a wordpress site and the Facebook Like plugin doesn't even show up on the datafeedr store product pages. Also, no luck with Google +1. Wp Tweet Button plugin shows up on these product pages but when you click to Tweet it just posts the store's homepage rather than the actual product page, regardless of which product page you're on.

No good, have to find a solution to utilize social media marketing.

Eric June 19th, 2012 09:15 AM

Here's how to add the Facebook Like button to your Product Detail page: /show...2741#post32741

All times are GMT -5. The time now is 01:03 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.