Jump to content

Archived

This topic is now archived and is closed to further replies.

Jayman11

HOW TO: Facebook "Like" Button in OSCommerce

Recommended Posts

I have this ver on hard drive to see what I can do with it. Below is image showing where the text at bottom of the box is being cut off. I've looked under modules and in the languages files in search of where this can be fixed, but keep coming to dead end. I have tried to increase the padding for the infoboxcontens, but to no prevail. Any clues?

 

Thank you.

 

I know this reply comes late but perhaps it can help anyway, to fix the text being cut off, in shop admin>modules>social bookmarks>facebook like, increase the iframe width, that'll spread the text over a longer line and it won't be cut off anymore.


~ Don't mistake my kindness for weakness ~

Share this post


Link to post
Share on other sites

Actually a better way to deal with this is alter the height of the iframe in includes>modules>social_bookmarks>sb_facebook_like.php

 

Change:

return '<iframe src="http://www.facebook.com/plugins/like.php?href=' . urlencode(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false)) . '&layout=' . $style . '&show_faces=' . $faces . '&width=' . $width . '&action=' . $action . '&colorscheme=' . $scheme . '&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' . $width . 'px; height:35px;" allowTransparency="true"></iframe>';
   }

 

to:

return '<iframe src="http://www.facebook.com/plugins/like.php?href=' . urlencode(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false)) . '&layout=' . $style . '&show_faces=' . $faces . '&width=' . $width . '&action=' . $action . '&colorscheme=' . $scheme . '&height=60" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' . $width . 'px; height:60px;" allowTransparency="true"></iframe>';
   }

 

or whatever height you prefer.


~ Don't mistake my kindness for weakness ~

Share this post


Link to post
Share on other sites

Hi, I'm not a developer but this seems easy enough that I tried it on my own. I copied the first code snippet into catalog/includes/header.php and I copied the second code snippet, with my application id pasted in, into catalog/includes/footer.php.

 

I saved my files in my FTP server (Dreamweaver) and expected everything to work...it doesn't. Is there anything I might have done wrong??

 

Thanks

Share this post


Link to post
Share on other sites

I took a while to figure this out, Facebook changed code or something

This works for me, place it where you need to display the button

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


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites

Hi friends

 

I am trying to get a Facebook like button onto my products pages but I am having some trouble as I'm using STS.

 

I have a template for my products in STS, so I can't place anything but html in there.

I'm assuming I will need to add a new variable tag to sts_user_code.php e.g. #facebooklike

 

Is it something like this

$sts->template['facebooktag']='<div class="fb-like" data-href="http://www.mysite.com<? echo $_SERVER['PHP_SELF']."?products_id=".$product_info['products_id'] ; ?>" data-send="true" data-width="450" data-show-faces="true"></div>';

 

Could someone please explain how I can do this?

Thanks

Share this post


Link to post
Share on other sites

×