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
 
Hi

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
Charles

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.

Eric

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="http://connect.facebook.net/pl_PL/all.js#xfbml=1"></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="http://www.facebook.com/widgets/like.php?href=<?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="http://www.facebook.com/widgets/like.php?href="""
scrolling="no" frameborder="0"
style="border:none; width:auto; height:24px;"></iframe>


creates the like button, but with an url error.

Example:
http://www.fashionguide.pl/store/pas...3600984319869/

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:
Code:

<script src="http://connect.facebook.net/pl_PL/all.js#xfbml=1"></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?

Code:

<iframe src="http://www.facebook.com/widgets/like.php?href=<?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="http://connect.facebook.net/pl_PL/all.js#xfbml=1"></script>
<fb:like
        class="fb_edge_widget_with_comment fb_iframe_widget"
        href="http://www.fashionguide.pl/store/paski/ochre-skinny-jean-belt-3600984319869/"
        show_faces="false"
        width="450"
        font="arial"
>

<span>
<iframe
        src="http://www.facebook.com/plugins/like.php?
                channel_url=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D0%23cb%3Df2934407fbf6422%26origin%3Dhttp%253A%252F%252Fwww.fashionguide.pl%252Ff187ee0cd893ce%26relation%3Dparent.parent%26transport%3Dpostmessage&amp;
                font=arial&amp;
                href=http%3A%2F%2Fwww.fashionguide.pl%2Fstore%2Fpaski%2Fochre-skinny-jean-belt-3600984319869%2F&amp;
                layout=standard&amp;
                locale=pl_PL&amp;
                node_type=link&amp;
                sdk=joey&amp;
                show_faces=false&amp;
                width=450"
        class="fb_ltr"
        title="Like this content on Facebook."
        style="border: medium none; overflow: hidden; height: 23px; width: 450px;"
        name="f2ad42f59342e6c"
        id="f301a6606e29fc"
        scrolling="no"
>

</iframe>
</span>
</fb:like>

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.

Eric

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.

http://developers.facebook.com/docs/opengraph/

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

<!-- BEGIN FACEBOOK LIKE CODE -->
<meta property="og:site_name" content="mywebsite" />
<meta property="og:title" content="[product.name]"/>
<meta property="og:image" content="[product.image]"/>
<meta property="og:description" content="[product.description cut='255 chars']"/>
<!-- END FACEBOOK LIKE CODE -->

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

euroads...
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.

http://developers.facebook.com/tools/debug

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.