Jump to content



Latest News: (loading..)

* * * * * 2 votes

HOW TO: Facebook "Like" Button in OSCommerce


  • Please log in to reply
80 replies to this topic

#21   Francys

Francys
  • Members
  • 124 posts
  • Real Name:Francis
  • Gender:Male

Posted 16 May 2010 - 07:33 PM

View PostMeawtuzA, on 15 May 2010 - 06:56 AM, said:

Thank yoou very much :thumbsup:

i wouldn't use addthis button in a oscommerce shop, since it's a third party application and some information can be collected by them.

i think the best is to use like they have these forums.

#22   supplementler

supplementler
  • Members
  • 19 posts
  • Real Name:sup
  • Gender:Male

Posted 03 June 2010 - 08:36 AM

Hello,

is it possible to add this on each product description site ? (product_info.php)

Can anyone explain me what i need to do if i want that ?

Which codes need to be added ? and where.. ?

Thanks.

#23   supplementler

supplementler
  • Members
  • 19 posts
  • Real Name:sup
  • Gender:Male

Posted 06 June 2010 - 05:54 PM

Any one ?

#24   Francys

Francys
  • Members
  • 124 posts
  • Real Name:Francis
  • Gender:Male

Posted 14 June 2010 - 01:17 PM

View Postsupplementler, on 06 June 2010 - 05:54 PM, said:

Any one ?

The best is to install this add on that posts the products details for social bookmarks:

Contrib Osc_socializer

http://addons.oscommerce.com/info/6054

http://forums.oscommerce.com/index.php?showtopic=307038

Cheers
Francys

#25   piou

piou
  • Members
  • 35 posts
  • Real Name:piou flame
  • Gender:Male

Posted 20 July 2010 - 02:28 PM

hi there,

to prevent session ids in the links posted on facebook just add the following line to the spiders.txt

facebookexternalhit

greetz

#26   piou

piou
  • Members
  • 35 posts
  • Real Name:piou flame
  • Gender:Male

Posted 21 July 2010 - 12:25 PM

hi there, again,

just noticed, that there is a problem with some IE versions. somehow some IE user are redirected to a blank page with a "?fb_xd_fragment..." string at the end of the address.

google told me, that this is a now bug that is not solved yet:

http://bugs.developers.facebook.com/show_bug.cgi?id=9777

since such blank pages will aren't really user friendly i'll give the iframe a try!

greetz

#27   papalapap

papalapap
  • Members
  • 10 posts
  • Real Name:Ben

Posted 17 August 2010 - 03:53 PM

View Postpiou, on 20 July 2010 - 02:28 PM, said:

hi there,

to prevent session ids in the links posted on facebook just add the following line to the spiders.txt

facebookexternalhit

greetz

hey piou, thx for your hint,
but thats not working for me, put in "facebookexternalhit" to includes/spiders.txt but oscid is still given over to facebook :/

Isnt there some way to edit
	  href="<?php echo HTTP_SERVER . $_SERVER['REQUEST_URI']; ?>"
to exclude the session id in some way?

#28   piou

piou
  • Members
  • 35 posts
  • Real Name:piou flame
  • Gender:Male

Posted 17 August 2010 - 06:45 PM

Quote

but thats not working for me, put in "facebookexternalhit" to includes/spiders.txt but oscid is still given over to facebook :/

hey papalapap, for me the spiders.txt works fine! How do you check whether the facebookbot gets an ID? Do the other bots get an ID? Maybe your spiders.txt is not working properly.

greetz

#29   papalapap

papalapap
  • Members
  • 10 posts
  • Real Name:Ben

Posted 17 August 2010 - 07:44 PM

View Postpiou, on 17 August 2010 - 06:45 PM, said:

hey papalapap, for me the spiders.txt works fine! How do you check whether the facebookbot gets an ID? Do the other bots get an ID? Maybe your spiders.txt is not working properly.

greetz


Uhmn, i dont know realy, i´ve "Prevent Spider Sessions" on true in configuration, not shure if that have something to do with this.
What i test is, click the Like Button, look up on my facebook pinboard, and get/see a URL with the oscID :/

#30   Aarto

Aarto
  • Members
  • 6 posts
  • Real Name:Aarto Reponen

Posted 20 August 2010 - 06:34 PM

Hi all!  I tried everything in this post and nothing could make thebutton show up on IE
I finally restorted to this (and it works)
I have enclosed the call to the fb script in <DIV> tags in includes/column_right.php

<div class="moduletable">
<!DOCTYPE html>
  <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>www.Nhuy.dk</title>
  </head>
  <body>
<fb:like
      href="<?php echo HTTP_SERVER . $_SERVER['REQUEST_URI']; ?>"
      layout="button_count"
      show_faces="true"
      width="<?php echo BOX_WIDTH-30; ?>"
      action="like"
      font="trebuchet ms"
      colorscheme="light">
</fb:like>
</body>
</html>
</div>


Now the button shows up in all browsers..    :-)

/Aarto
Buddha figurer, smykker, bambus vaser, thai figurer

#31   web-project

web-project
  • Members
  • 4,320 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Hertfordshire, UK

Posted 20 August 2010 - 08:02 PM

have you tried the following website:
http://developers.facebook.com/

plenty code and very easy to integrate to oscommerce or any other websites.
Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!
8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.
Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.
Any issues with oscommerce, I am here to help you.

#32   sakkiotto

sakkiotto
  • Members
  • 62 posts
  • Real Name:manuel

Posted 31 August 2010 - 11:49 AM

View PostFrancys, on 03 May 2010 - 12:20 PM, said:

First thank you very much, by sharing with us your project, i was looking for this for awhile, can't wait to try this...

You are doing awesome, if possible this should be made as a contribution aswell, many many congratulations

more interesting for contrib... i have app id , insert on code in footer but i not show the iframe...

#33   burt

burt

    Code Monkey

  • Community Team
  • 7,754 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 23 September 2010 - 09:09 AM

The iframe version of the FB::like comes as standard in the soon-to-be-release 2.3 version of osCommerce.
Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#34 ONLINE   knifeman

knifeman
  • Members
  • 1,674 posts
  • Real Name:Tim
  • Gender:Male

Posted 23 September 2010 - 11:14 PM

View PostAarto, on 20 August 2010 - 06:34 PM, said:

Hi all!  I tried everything in this post and nothing could make thebutton show up on IE
I finally restorted to this (and it works)
I have enclosed the call to the fb script in <DIV> tags in includes/column_right.php

<div class="moduletable">
<!DOCTYPE html>
  <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>www.Nhuy.dk</title>
  </head>
  <body>
<fb:like
      href="<?php echo HTTP_SERVER . $_SERVER['REQUEST_URI']; ?>"
      layout="button_count"
      show_faces="true"
      width="<?php echo BOX_WIDTH-30; ?>"
      action="like"
      font="trebuchet ms"
      colorscheme="light">
</fb:like>
</body>
</html>
</div>


Now the button shows up in all browsers..    :-)

/Aarto
Buddha figurer, smykker, bambus vaser, thai figurer
Hello Aarto,

I am also trying to include the like button. I did not want to use my card to get an app id, so i tried your solution. Nothing I did would put a button on my site. Can you post the code for your FB box and be more specific about where to paste the other code in column_right?

Tim

#35 ONLINE   knifeman

knifeman
  • Members
  • 1,674 posts
  • Real Name:Tim
  • Gender:Male

Posted 24 September 2010 - 11:12 PM

View Postknifeman, on 23 September 2010 - 11:14 PM, said:

Hello Aarto,

I am also trying to include the like button. I did not want to use my card to get an app id, so i tried your solution. Nothing I did would put a button on my site. Can you post the code for your FB box and be more specific about where to paste the other code in column_right?

Tim
Looking closer at the site from Aarto, there is no like button only a FB button. So I finally created an app ID and was presented with this code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>Site name</title>
  </head>
  <body>
	<h1>Site name</h1>
	<p><fb:login-button autologoutlink="true"></fb:login-button></p>
	<p><fb:like></fb:like></p>

	<div id="fb-root"></div>
	<script>
	  window.fbAsyncInit = function() {
		FB.init({appId: 'MY APP ID NUMBER', status: true, cookie: true,
				 xfbml: true});
	  };
	  (function() {
		var e = document.createElement('script');
		e.type = 'text/javascript';
		e.src = document.location.protocol +
		  '//connect.facebook.net/en_US/all.js';
		e.async = true;
		document.getElementById('fb-root').appendChild(e);
	  }());
	</script>
  </body>
</html>

I took out my actual site name and app id for this posting. This is all the code I needed. I can put this wherever I want and the like button appears. Maybe things have changed since this thread first started....

Does anyone know how to alter this code to remove the faces or change the button layout? If you get code from this page:
http://developers.facebook.com/docs/reference/plugins/like
There are places to alter the behavior, but I do not see these features in the code I used. I changed status to false and saw no difference. I changed xfbml to false and all but the site name went away. To be honest, I do not even know why it works when all the posts go on about 2 different pieces of code need to be added.

Tim

#36   Aarto

Aarto
  • Members
  • 6 posts
  • Real Name:Aarto Reponen

Posted 28 September 2010 - 07:35 PM

View Postknifeman, on 23 September 2010 - 11:14 PM, said:

Hello Aarto,

I am also trying to include the like button. I did not want to use my card to get an app id, so i tried your solution. Nothing I did would put a button on my site. Can you post the code for your FB box and be more specific about where to paste the other code in column_right?

Tim

Well.. it worked fine but i removed it after a warning.. Turns out it's really dangerous from SEO perspective to repeat the <header> tags in a single web page and it could have been interpreted by Google as cheating and could have causes the site to be penalized..  So i'm back to not having a like button again...  Sorry.

/Aarto
http://www.nhuy.dk/shop

#37   sonictrip.net

sonictrip.net
  • Members
  • 217 posts
  • Real Name:Fran
  • Gender:Male
  • Location:Dublin

Posted 04 October 2010 - 07:19 AM

I was having problems getting this to work because i had the script in the footer, which doesnt seem to work, here's what worked for me:

Open catalog/index.php and catalog/product_info.php and find:

<html <?php echo HTML_PARAMS; ?>>

Change to:

<html <?php echo HTML_PARAMS; ?> xmlns:fb="http://www.facebook.com/2008/fbml">

Open catalog/product_info.php

Paste the following code wherever you want the Like button to appear such as between any <td> </td> tags:

<fb:like
	  href="<?php echo HTTP_SERVER . $_SERVER['REQUEST_URI']; ?>"
	  layout="standard"
	  show_faces="false"
	  width="300"
	  action="like"
	  font="trebuchet ms"
	  colorscheme="light"></fb:like> 
	  <div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({appId: 'App ID Number', status: true, cookie: true, xfbml: true});
  FB.Event.subscribe('auth.sessionchange', function(response) {
	if (response.session) {
	  // A user has logged in, and a new cookie has been saved
	} else {
	  // The user has logged out, and the cookie has been cleared
	}
  });
</script> 

Works in IE and Firefox.

#38   jack_frost

jack_frost
  • Members
  • 194 posts
  • Real Name:Jesper

Posted 18 October 2010 - 10:38 AM

I am having two problems with this:

1; i cant seem to get the Like box under my product describtion. it is either in the top of my page, or in the bottom (depinding on where i put it in the .PHP file.

2; when pressing the botton, it gives out an error, and the reason is, the the URL it generates is wrong.

instead of http://Fatima.dk/shop/catalog/product_info.php?products_id=1396 it says "http://HTTP_SERVER/shop/catalog/product_info.php?products_id=1396"

When asked of the site URL in the Facebook develp. thing, i wrote http://www.fatima.dk/

was this wrong?.

- Jack

#39   jack_frost

jack_frost
  • Members
  • 194 posts
  • Real Name:Jesper

Posted 18 October 2010 - 10:40 AM

DP

Edited by jack_frost, 18 October 2010 - 10:40 AM.


#40   jack_frost

jack_frost
  • Members
  • 194 posts
  • Real Name:Jesper

Posted 18 October 2010 - 12:14 PM

Nevermind! - Fixed Both Problems!

Now, a new one have presented it self.

When Pressing on a Like botton, the like info on my FB page, Says:

Jack Likes "Store name" on fatima.dk.

How do i make it say Jack Likes "Product Name" on fatima.dk.