Forums / Templates, Stylesheets, Page Layout / Facebook "Like" button on every product page?

Facebook "Like" button on every product page?

Views: 47,305

Results 81 to 100 of 115
17 Nov 2010, 8:05 PM
#81
shazam_nz avatar

shazam_nz

New Zenner

Join Date:
Sep 2009
Posts:
8
Plugin Contributions:
0

Facebook "Like" button on every product page?

Hm, all of these tutorials are for adding the 'like' to the product page, which is all good.. however I want to add it to my header.

I've done it, and it works when it's on a product page - however when on the main page it tries to generate the product ID which it can't do, and so generates 0 and tries to link to that, which gives an error.

I was thinking of doing a bit of an IF work around, ie if mainpage, use a static like url, if on a product one, use the one i'm currently using.

Would this work? If so - what's the best way of implementing it?

Cheers!

18 Nov 2010, 2:39 PM
#82
delia avatar

delia

Totally Zenned

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

Re: Facebook "Like" button on every product page?

Oh, I see, this is not code that works directly with zencart but uses the addthis.com service. I didn't know they were offering the like button now.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

18 Nov 2010, 3:48 PM
#83
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Facebook "Like" button on every product page?

delia:

Oh, I see, this is not code that works directly with zencart but uses the addthis.com service. I didn't know they were offering the like button now.

Yes they offer it now. I still use numinix code to generate the image because it handles default images for non-product related pages whereas the code for this mod doesn't handle meta tag information correctly for non-product page.

Basically my implementation consists of:

  1. Implement numinix configuration options
  2. use AddThis code for page implementation (for where to display)
  3. Use this customized meta tags:
<meta property="og:title" content="<?php echo META_TAG_TITLE; ?>" />
<meta property="og:site_name" content="<?php echo STORE_NAME; ?>" />
<meta property="og:url" content="<?php echo $canonicalLink; ?>" />
<meta property="og:type" content="product" />
<meta property="fb:admins" content="MASKED" />
<meta property="fb:app_id" content="MASKED" />
<?php
  if (isset($_GET['products_id'])) { // use products_image if products_id exists
    $facebook_image = $db->Execute("select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id'] . "'");
    $fb_image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $facebook_image->fields['products_image'];
  } 
  if ($fb_image == '' && FACEBOOK_OPEN_GRAPH_DEFAULT_IMAGE != '') { // if no products image, use the default image if enabled
   $fb_image = FACEBOOK_OPEN_GRAPH_DEFAULT_IMAGE;
  }
  if ($fb_image != '') {
?>
<meta property="og:image" content="<?php echo $fb_image; ?>" />
<?php 
  }
?>
25 Jan 2011, 4:18 PM
#84
milobloom avatar

milobloom

Totally Zenned

Join Date:
Feb 2004
Posts:
1,267
Plugin Contributions:
1

Re: Facebook "Like" button on every product page?

The install was easy for me.

However it is grabbig the image for the wrong item. Its grabbing the navigation image instead of the main image.

Any way to fix this?

Used this code in info_display

<iframe src="http://www.facebook.com/widgets/like.php?href=<?php echo zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath= '.(int)$_GET['cPath'].' &products_id=' . (int)$_GET['products_id']); ?>" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe>

http://www.allforyourwedding.com/handbag-shaped-note-pad-lipstick-shaped-pen-wedding-favor-p-15986.html

25 Jan 2011, 4:38 PM
#85
delia avatar

delia

Totally Zenned

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

Re: Facebook "Like" button on every product page?

This thread is for the Facebook Like Button mod and that code is not in the mod. The only way you can get the correct product images and information to show up consistently would be to use the mod and not the iframe suggested above.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

6 Apr 2011, 11:34 AM
#87
kdays avatar

kdays

Zen Follower

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

Re: Facebook "Like" button on every product page?

I didn't have any issues on your site and I tried both logged in and not logged in to Facebook. When I liked 'Friends of the Earth' it used the DL Sounds logo. Is there a product image or is that how you want it to work?

6 Apr 2011, 12:56 PM
#88
delia avatar

delia

Totally Zenned

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

Re: Facebook "Like" button on every product page?

pascal020:

Great mod!

But user can only see pictures when they are logged in FB

Sometimes ther's even a message that you have to register to facebook

http://www.dl-sounds.com/index.php?main_page=product_music_info&products_id=355

Any solution for this?

thanks

Do you mean pictures of the people who like the site showing on your site?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

7 Apr 2011, 9:25 AM
#89
pascal020 avatar

pascal020

New Zenner

Join Date:
Aug 2009
Posts:
43
Plugin Contributions:
0

Re: Facebook "Like" button on every product page?

Thank you Kdays, and yes, we do not use product images.

Delia, yes, like this site:

http://www.rajasthanistore.com/

7 Apr 2011, 11:47 AM
#90
delia avatar

delia

Totally Zenned

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

Re: Facebook "Like" button on every product page?

Then that's the way Facebook wants it. Not under our control.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

7 Aug 2011, 11:58 AM
#91
dmagic avatar

dmagic

Totally Zenned

Join Date:
Oct 2008
Posts:
594
Plugin Contributions:
0

Re: Facebook "Like" button on every product page?

my code is :
PHP Code:

<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='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:40px"></iframe> 

But in my FB have mistake with the picture ! it's from Bestsellers not from the product information.

How can fixed ?

http://www.king-magic.com

Thanks

7 Aug 2011, 2:07 PM
#92
delia avatar

delia

Totally Zenned

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

Re: Facebook "Like" button on every product page?

Well, you obviously aren't using the mod that this thread is about.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

7 Jun 2012, 5:19 PM
#93
pricediscrimination avatar

pricediscrimination

Zen Follower

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

Re: Facebook "Like" button on every product page?

Why is it so difficult to add fully functional share buttons on the zen cart product pages?! Ridiculous :bangin::excl::frusty::yuck::censored::rant:

7 Jun 2012, 5:31 PM
#94
delia avatar

delia

Totally Zenned

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

Re: Facebook "Like" button on every product page?

It's not zen cart - it's facebook and all those APIs created by all those sites you are wanting to share with. This mod works as intended.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

15 Jun 2012, 7:05 PM
#95
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Facebook "Like" button on every product page?

<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='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:40px"></iframe>

Is what I use. Works perfect on one site and on the 2nd my pictures are not showing on facebook. Any ideas?

Live and learn... the Zen way.

15 Jun 2012, 7:08 PM
#96
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Facebook "Like" button on every product page?

mydanilo:

<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='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:40px"></iframe> ``` > > Is what I use. Works perfect on one site and on the 2nd my pictures are not showing on facebook. Any ideas?

OK, just realized that there is actually a mod with other code here. I'll give it a shot and post back. Sorry was a bit too fast.

Live and learn... the Zen way.

16 Jun 2012, 12:05 PM
#98
cultureclick avatar

cultureclick

New Zenner

Join Date:
May 2012
Posts:
93
Plugin Contributions:
0

Re: Facebook "Like" button on every product page?

Okay, just a little burble from a newbie:

Doing it this way would mean that people could "like" any particular item, i.e. if you were selling clothing, they could like the men's department Manly Pink Feather Boa, without liking your website as a single entity? So all those guys on Facebook who are dying for a Manly Pink Feather Boa would see their friends like that particular product?

Yours,

CultureClick the baby Zenner

16 Jun 2012, 12:24 PM
#99
delia avatar

delia

Totally Zenned

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

Re: Facebook "Like" button on every product page?

If you want to talk about something besides the facebook like button mod I did, please do it in another thread. I do monitor this thread and answer when necessary so you are just creating a time waster for me.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

24 Nov 2012, 2:21 PM
#100
delia avatar

delia

Totally Zenned

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

Re: Facebook "Like" button on every product page?

Nope, not that I know of. Facebook is going to pull whatever image it finds. If the image isn't there that's supposed to be, well, you end up getting almost anything.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo