Zen Cart Logo
Forums / All Other Contributions/Addons / Facebook Like Button

Facebook Like Button

Views: 52,534

Results 161 to 180 of 347
4 Jun 2011, 8:54 PM
#161
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Facebook Like Button

Installed the mod and got this error:

"The app ID specified within the "fb:app_id" meta tag is not allowed on this domain. You must setup the Connect Base Domains for your app to be a prefix of..."

Then I used the code from Facebook and it worked except when the product was liked it showed up on the Facebook wall but did not register the count number next to the like button on the product page:

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=xxxxxxxxx&xfbml=1"></script><fb:like href="" send="false" layout="button_count" width="400" show_faces="false" font="arial"></fb:like>

So my question is why does the mod call for this code and not the code from Facebook when putting it in the tpl_product_info_display.php ??

 <!-- bof Facebook Like Button -->
    <div id="likeButton"><fb:like></fb:like></div>

    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: 'your application id', status: true, cookie: true,
                 xfbml: true});
		FB.Event.subscribe('edge.create', function(href, widget) {
// Do something, e.g. track the click on the "Like" button here
});
      };
      (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>
<!-- eof Facebook Like Button -->

What is the difference between your code and the Facebook code?

4 Jun 2011, 9:30 PM
#162
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Facebook Like Button

pricediscrimination:

Installed the mod and got this error:

Then I used the code from Facebook and it worked except when the product was liked it showed up on the Facebook wall but did not register the count number next to the like button on the product page:

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=xxxxxxxxx&xfbml=1"></script><fb:like href="" send="false" layout="button_count" width="400" show_faces="false" font="arial"></fb:like> ```So my question is why does the mod call for this code and not the code from Facebook when putting it in the tpl_product_info_display.php ?? > ``` <!-- bof Facebook Like Button --> <div id="likeButton"><fb:like></fb:like></div>
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: '[B]your application id[/B]', status: true, cookie: true,
             xfbml: true});
    FB.Event.subscribe('edge.create', function(href, widget) {

// Do something, e.g. track the click on the "Like" button here
});
};
(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>

<!-- eof Facebook Like Button -->


not sure why fb code worked from the fb site---I sure never could get it to work right.

I did however in that where I made red put my fb id and also in the other place it indicated for it to go within the meta tags. now when I hit the like link (I removed the thumbs up obnoxious button) it gives the box to post it to my fb page and even gives the image of our store item.
4 Jun 2011, 11:40 PM
#163
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: Facebook Like Button

DarkAngel:

I did however in that where I made red put my fb id and also in the other place it indicated for it to go within the meta tags. now when I hit the like link (I removed the thumbs up obnoxious button) it gives the box to post it to my fb page and even gives the image of our store item.
:unsure: huh?

5 Jun 2011, 1:29 AM
#164
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Facebook Like Button

pricediscrimination:

:unsure: huh?

in this area where I have made it red:

<!-- bof Facebook Like Button -->
<div id="likeButton"><fb:like></fb:like></div>

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: '**your application id**', status: true, cookie: true,
             xfbml: true});

you need to replace the red letters with your apps id or your id at facebook that is usually found in the url of your page there

there is also another section to be adding the information to the meta tag section....if you are using this fb mod:

facebook_like_button_1-0.zip

it is listed in the readme where to add it

5 Jun 2011, 2:26 AM
#165
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: Facebook Like Button

DarkAngel:

in this area where I have made it red:

<!-- bof Facebook Like Button -->
<div id="likeButton"><fb:like></fb:like></div>

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: '**your application id**', status: true, cookie: true,
             xfbml: true});

you need to replace the red letters with your apps id or your id at facebook that is usually found in the url of your page there

there is also another section to be adding the information to the meta tag section....if you are using this fb mod:

facebook_like_button_1-0.zip

it is listed in the readme where to add it

Yes, I did all of thes steps that you mentioned and it still didn't work. However, using the code directly from Facebook (as I posted above) did work.

And my question was why does this mod use code that is so different than the code provided by Facebook and why?

5 Jun 2011, 2:37 AM
#166
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Facebook Like Button

pricediscrimination:

Yes, I did all of thes steps that you mentioned and it still didn't work. However, using the code directly from Facebook (as I posted above) did work.

And my question was why does this mod use code that is so different than the code provided by Facebook and why?

I don't know but I do know that I use the mods code and NOT the one from FB BUT...I did have to go to google and do the little bit of allowing that I think is mentioned at FB where their code is found

5 Jun 2011, 12:20 PM
#167
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Facebook Like Button

pricediscrimination:

What is the difference between your code and the Facebook code?

  1. Both are facebook code.
  2. look at the code - one uses an http url to access facebook, one does not
  3. so this mod uses code that will not throw a security error
  4. when originally coded this was the only way to get more than a link on facebook - that's now changed. Still get more on the facebook post with this mod tho.

My question to you is why didn't you ask about the error you received? I know the answer and it has been discussed in this thread before. You didn't finish your install.

5 Jun 2011, 6:56 PM
#168
Join Date:
Jul 2010
Location:
Findon, UK
Posts:
90
Plugin Contributions:
0

Re: Facebook Like Button

I installed the Facebook Like Button and changed the files according to the instructions. However, nothing shows up in Microsoft Internet Explorer 8 . But in Google Chrome it does work. The only disadvantage is that the add-on has changed (increased) the font size on my site. Furthermore, the text "Be the first of your friends to like this" can't been seen on the site's black background.

My site is https://www.PUREchocolatetrruffles.co.uk

Any advice is very welcome. Thanks in advance.
Kim

5 Jun 2011, 10:36 PM
#169
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Facebook Like Button

delia:

1)You didn't finish your install.

LOL, I could kick myself but I totally forgot about having them check to make sure all files were done...something I almost always state.

I love your mod Delia

5 Jun 2011, 10:39 PM
#170
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Facebook Like Button

PUREchocolatetruffle:

I installed the Facebook Like Button and changed the files according to the instructions. However, nothing shows up in Microsoft Internet Explorer 8 . But in Google Chrome it does work. The only disadvantage is that the add-on has changed (increased) the font size on my site. Furthermore, the text "Be the first of your friends to like this" can't been seen on the site's black background.

My site is www.PUREchocolatetrruffles.co.uk

Any advice is very welcome. Thanks in advance.
Kim

I have a dark back also -- try this in the tpl_product_info.php

<div id="likeButton"><fb:like colorscheme="dark"></fb:like></div>
6 Jun 2011, 11:50 AM
#171
Join Date:
Jul 2010
Location:
Findon, UK
Posts:
90
Plugin Contributions:
0

Re: Facebook Like Button

DarkAngel:

I have a dark back also -- try this in the tpl_product_info.php

<div id="likeButton"><fb:like colorscheme="dark"></fb:like></div> ```

Dark Angel, many thanks. Your code gave me an idea as I have now changed the tpl_product_info.php with this

<iframe src="http://www.facebook.com/plugins/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'])); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=dark" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:300px; height:40px"></iframe>

I've also reduced the width to 300 px so the "like botton" doesn't push my side boxes out anylonger.

Dark Angel, you seem to be anywhere. It's not the first time you have helped me. Once again many thanks.

Kim

6 Jun 2011, 11:53 AM
#172
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Facebook Like Button

If your cart goes to secure after you login, that code will throw a security error. You could have just added the the color scheme tag to the existing code.

6 Jun 2011, 2:51 PM
#173
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Facebook Like Button

PUREchocolatetruffle:

Dark Angel, many thanks. Your code gave me an idea as I have now changed the tpl_product_info.php with this

<iframe src="http://www.facebook.com/plugins/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'])); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=dark" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:300px; height:40px"></iframe>

I've also reduced the width to 300 px so the "like botton" doesn't push my side boxes out anylonger.

Dark Angel, you seem to be anywhere. It's not the first time you have helped me. Once again many thanks.

Kim

I'm here, I'm there, I'm verywhere so b e w a r e....lol

glad I could help out a little

8 Jun 2011, 8:38 AM
#174
Join Date:
Jul 2010
Location:
Findon, UK
Posts:
90
Plugin Contributions:
0

Re: Facebook Like Button

delia:

If your cart goes to secure after you login, that code will throw a security error. You could have just added the the color scheme tag to the existing code.

Nope, no security error comes up. However, I did change it and added DarkAngel's code instead.
And now my website looks good again in the Chrome browser.

May I ask, how do I make the width shorter in the Like Button line ? It was easy to do in the iframe code but I can't make it work now.

Otherwise, many thanks for a great programme.

Kim

9 Jun 2011, 4:11 PM
#175
Join Date:
Jul 2010
Location:
Findon, UK
Posts:
90
Plugin Contributions:
0

Re: Facebook Like Button

PUREchocolatetruffle:

Nope, no security error comes up. However, I did change it and added DarkAngel's code instead.
And now my website looks good again in the Chrome browser.

May I ask, how do I make the width shorter in the Like Button line ? It was easy to do in the iframe code but I can't make it work now.

Otherwise, many thanks for a great programme.

Kim

Sorted by myself by adding "width= 300px" in DarkAngel's code.
However, I have another question that really puzzles me:
The Facebook Like Button is placed perfectly above the product where it should in the Chrome browser and Microsoft Internet Explorer 9. But in Microsoft Internet Explorer 7 and 8 the Facebook Like Button is only visible down in the left corner of the screen.
How come ? Isn't it weird ?

Kim

9 Jun 2011, 4:26 PM
#176
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Facebook Like Button

Not really - each browser does different thing with css. Getting cross browser compliant css can be problematic.

9 Jun 2011, 6:09 PM
#177
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Facebook Like Button

PUREchocolatetruffle:

Sorted by myself by adding "width= 300px" in DarkAngel's code.
However, I have another question that really puzzles me:
The Facebook Like Button is placed perfectly above the product where it should in the Chrome browser and Microsoft Internet Explorer 9. But in Microsoft Internet Explorer 7 and 8 the Facebook Like Button is only visible down in the left corner of the screen.
How come ? Isn't it weird ?

Kim

kudos for figuring it out yourself...sometimes when I do that it won't even show the image...lol

I don't know why it does that I do not have mine showing at the top above image I positioned mine right below it, just between the image and the descritpion

20 Jun 2011, 7:09 PM
#178
fran avatar

fran

New Zenner

Join Date:
Oct 2005
Posts:
67
Plugin Contributions:
0

Re: Facebook Like Button

If anyone is using an SEO mod such as Ceon URI's and the URL string with $canonicalLink is not working, use this bit of code instead of the normal og:url:

<meta property="og:url" content="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER) . $request_uri; ?>" />

So the full bit of code im using on 1.3.9h with Ceon URI's is:

<meta property="og:title" content="<?php echo META_TAG_FBTITLE; ?>" />
<meta property="og:site_name" content="<?php echo TITLE; ?>" />
<meta property="og:image" content="<?php echo META_TAG_FBIMG; ?>" />
<meta property="og:url" content="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER) . $request_uri; ?>" />
<meta property="fb:app_id" content="APP ID" />
<meta property="og:type" content="product" />
20 Jun 2011, 7:45 PM
#179
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Facebook Like Button

Thanks, Fran, I'll check that out and incorporate it into the instructions!

21 Jun 2011, 1:30 PM
#180
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Facebook Like Button

How do I change the color of the text that is next to the "like" icon?