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

Facebook "Like" button on every product page?

Views: 47,305

Results 41 to 60 of 115
26 Jun 2010, 7:21 AM
#41
colins avatar

colins

New Zenner

Join Date:
May 2009
Posts:
5
Plugin Contributions:
0

Facebook "Like" button on every product page?

Facebook Like, Share and Add this pop up menu

I have edited the file slightly and pasted the code into a different location on the product page (My product image would not display if the code was pasted above the image in ie8)

Used with Zen Cart 1.3.8a.

Edited and working in heavily customised site http://www.digitaleasy.co.nz/ecommerce/index.php?main_page=product_info&cPath=398&products_id=5769

Not tested in 1.3.9 since It may not work with Facebook Like button links.

If you're using SEO links you'll have to edit the Facebook Like button below to

<iframe src="http://www.facebook.com/plugins/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']); ?>&layout=button_count&show_faces=false&width=80&action=like&font=arial&colorscheme=light&height=35" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:35px"></iframe>
  1. Backup includes\templates\template_default\templates\tpl_product_info_display.php and COPY it to includes\templates\YOUR_TEMPLATE\templates\tpl_product_info_display.php edit the file in YOUR_TEMPLATE and no other, keeping the template_default intact as backup.

  2. Here's the code with comments. Read them and edit as needed. You do NOT need to edit other files.

<!--bof Socialize -->
<style type="text/css">
	

div.share {float: right; }


	div.share ul {float:right; list-style-type:none; padding:0;} 
	div.share li {float:left; display:inline; padding:0 5px;} 
</style>

<div class="share">
	<ul>

		<li>
			<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> <!-- seperate Facebook share button -->
		</li>
		<li>
			<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=button_count&show_faces=false&width=80&action=like&font=arial&colorscheme=light&height=35" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:35px"></iframe> <!-- Facebook button_count Like button using standard Zen Cart product links -->
		</li>
		<li>
			<span class="addthis_toolbox addthis_default_style"> <!-- simple www.addthis.com expandable button. Register to get statistics and edit USERNAME. Remove the img src tag to use addthis standard icon -->
				<a href="http://www.addthis.com/bookmark.php?v=250&username=USERNAME" class="addthis_button_compact">
				 More</a>
			</span>
			<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=USERNAME"></script>
		</li>
	</ul>
</div>
<!--eof Socialize -->
  1. Edit includes\templates\YOUR_TEMPLATE\templates\tpl_product_info_display.php
    Copy and paste code after <!--eof Main Product Image-->

Get a Social Media on!

Hack by Colin S)
Original code by scrap

28 Jun 2010, 6:34 PM
#42
alwaysriding avatar

alwaysriding

New Zenner

Join Date:
Dec 2008
Posts:
26
Plugin Contributions:
0

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

Hi All,

I wanted to share some info for you about our experiences trying to integrate FB like.

We tried the iFrame and XFBML method. Both failed, and will never work because we use the Magic SEO URL module. This is incompatible with FB integration, and will result in only the basic site wide title and URL being passed to a user's FB wall.

No image, no meta data specific to the product, no description, nothing.

If anyone is trying it, please be aware of what we have experienced, it will save you a lot of time and headaches.

The unofficial word from Magic SEO is that they have no time to work around this, and it is safe to assume it will stay this way for the forseeable future.

In terms of alternatives, there are other URL modules out there, so we can't speak for those, they may work.

Thanks, Pete

28 Jun 2010, 7:02 PM
#43
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,883
Plugin Contributions:
20

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

<IMHO>

You can drop any SEO mods as the major search engines don't use them, Google prefers they not be used, and (as witnessed in trying to add FB like) they cause more problems than they are worth.

</IMHO>

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

29 Jun 2010, 10:58 PM
#44
alwaysriding avatar

alwaysriding

New Zenner

Join Date:
Dec 2008
Posts:
26
Plugin Contributions:
0

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

Hi All,

A little clarification is required.

Magic SEO URLS it turned out was not the issue at all. Jiri from MSU did some debugging for us, and we found it was an issue in our html header.

FB like, the XFBML method is now working beautifully, and you can see it here as an example.

I would like to retract my previous comments and say that the MSU system was not in anyway responsible for the issue we had.

Regarding the SEO URLS, all I can say is that our business increased by 400% the month after we started using them.

The figures speak for themselves.

29 Jun 2010, 11:57 PM
#45
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,883
Plugin Contributions:
20

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

GREAT! Love it when a site goes from 1 sale to 4:P

Seriously, most folks find the SEO URL stuff about 3 months after they start their site. Robots have found the site and the new activity of "changing" the site increases rank for a short time. However, following the tips at http://pro-webs.net/blog/2009/09/10/zen-cart-seo-12-steps/ (one of our own) will better serve one over the long run.

Here's a Google Webmaster article that's almost two years old. A good read.

We have never used any product to rewrite dynamic URLs and have one customer who is an authorized area distributor for his product. The main company has never made it to the same page. They are generally one or two behind in the search engines.

We try to follow the good advice of mprough to the letter and getting more into facebook is a large part of it as well.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

1 Jul 2010, 9:46 AM
#46
alwaysriding avatar

alwaysriding

New Zenner

Join Date:
Dec 2008
Posts:
26
Plugin Contributions:
0

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

Whatever works for you I guess, good luck with that...

31 Jul 2010, 5:25 AM
#47
neekfenwick avatar

neekfenwick

New Zenner

Join Date:
Feb 2009
Posts:
101
Plugin Contributions:
0

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

Just to add, don't forget to update your includes/spiders.txt file to include 'facebookexternalhit', or each page hit will be roughly doubled. See http://www.zen-cart.com/forum/showthread.php?t=159858&highlight=facebook

If you fetch the latest zen cart release, spiders.txt probably contains quite a few worthwhile additions to your own.

Those of you with really quite old zen cart installs may still have includes/application_top.php that calls counter.php without checking $spider_flag, again, see the latest code.

5 Aug 2010, 2:11 AM
#48
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

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

dbltoe:

GREAT! Love it when a site goes from 1 sale to 4:P

Seriously, most folks find the SEO URL stuff about 3 months after they start their site. Robots have found the site and the new activity of "changing" the site increases rank for a short time. However, following the tips at http://pro-webs.net/blog/2009/09/10/zen-cart-seo-12-steps/ (one of our own) will better serve one over the long run.

Here's a Google Webmaster article that's almost two years old. A good read.

We have never used any product to rewrite dynamic URLs and have one customer who is an authorized area distributor for his product. The main company has never made it to the same page. They are generally one or two behind in the search engines.

We try to follow the good advice of mprough to the letter and getting more into facebook is a large part of it as well.

About 18 months ago we inherited a site that was using Magic SEO URL's - and was getting poor rankings on the SE's.

We completely removed MagicSEO (a real pain in the ######## to do this, but we succeeded).

Within 4 months (using standard ZC dynaminc links) we were getting far better results.

Today - after following melanie prough's advice for nearly 6 months now - this site is getting GOOD serps, and business has increased dramatically.

These SEO URL mods are "snake oil"... avoid them completely.

20 years a Zencart User

11 Aug 2010, 10:30 AM
#49
xxdrag0nxx avatar

xxdrag0nxx

New Zenner

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

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

hey_you:

I've inserted the following code at line 284 (for me), between the following lines in blue:

} // CUSTOM META TAGS
if($product_info_metatags->fields['products_image']!='') {
$FBimgURL = (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ) . DIR_WS_IMAGES . $product_info_metatags->fields['products_image'];
define('META_TAG_FBIMG', $FBimgURL);
} else {
define('META_TAG_FBIMG', '');
}
define('META_TAG_FBTITLE', str_replace('"','',zen_clean_html($product_info_metatags->fields['products_name'])));
} // EOF
break;


Hi,

For this piece of code to generate the META_TAG_FBIMG, it generates the original uploaded image string.

IF I am using Image Handler 2, it uses a cached image, any advise how to mod this code to get that cached image link?

THis is the 3rd day I am trying already, no choice but to ask now :(

Thanks :)
12 Aug 2010, 1:01 AM
#50
ehinchman avatar

ehinchman

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

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

Does this code work with 1.3.9e?

Also, will the "Like" button image create the SSL error in IE about "Even though this site is secure, parts of it are linking to non secure items blah... blah... blah..."?

12 Aug 2010, 1:26 AM
#51
ehinchman avatar

ehinchman

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

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

ehinchman:

Does this code work with 1.3.9e?

Also, will the "Like" button image create the SSL error in IE about "Even though this site is secure, parts of it are linking to non secure items blah... blah... blah..."?

Nevermind, I just tried it out and it does create the SSL error.... Oh well... :frusty:

19 Aug 2010, 3:05 PM
#52
teaj avatar

teaj

New Zenner

Join Date:
Dec 2007
Location:
South, UK
Posts:
66
Plugin Contributions:
0

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

Is it possible for the user to 'like' the product name rather than the URL?

ie on their Facebook page it would say something like -

'Joe likes Nice Red Shoes on http://niceshoes.com'

rather than

'Joe likes http://niceshoes.com/main_page=product_info&cPath=1&products_id=3&zenid=40e1fade2c3cbac636e9540a8cb2b537'

Cheers :smile:

19 Aug 2010, 6:36 PM
#53
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,883
Plugin Contributions:
20

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

I'm sure you could code something BUT.... If it is showing a zenid, you have a problem.:shocking: Anyone who clicks on the link will possibly go into an existing cart/session.:no:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

22 Aug 2010, 12:48 PM
#54
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

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

Hello,

Does this Facebook Like button work on the latest version?

Thx

22 Aug 2010, 2:27 PM
#55
kevinmc3 avatar

kevinmc3

Totally Zenned

Join Date:
Jun 2006
Posts:
786
Plugin Contributions:
0

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

Berserker:

Hello,

Does this Facebook Like button work on the latest version?

Thx

Yes, works with 1.3.9c. But. it is a little flaky, NOT on the ZEN side but with Facebook. Sometimes Facebook will give you an error, but when you refresh you will see you connected and LIKE it

22 Aug 2010, 5:05 PM
#56
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

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

Thanks for the reply. As long as it works, that's good enough for me :)
Just need the facebook sidebox now

23 Aug 2010, 11:55 AM
#57
teaj avatar

teaj

New Zenner

Join Date:
Dec 2007
Location:
South, UK
Posts:
66
Plugin Contributions:
0

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

dbltoe:

I'm sure you could code something BUT.... If it is showing a zenid, you have a problem.:shocking: Anyone who clicks on the link will possibly go into an existing cart/session.:no:

Thanks, I'm not sure why that's happening. I'll look into that first.....it's constantly appended on to all URLs on the website I'm currently working on :unsure:

Perhaps it could be a sever side issue, as I dont have this problem with my other zen shops.

Cheers

26 Aug 2010, 7:29 PM
#58
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

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

That looks like a really good idea but I only want the facebook likes link to appear on my landing/main page preferably in the righthand sidebox area - where would I put the code in this case?

30 Aug 2010, 12:26 PM
#59
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?

alwaysriding:

Hi All,

A little clarification is required.

Magic SEO URLS it turned out was not the issue at all. Jiri from MSU did some debugging for us, and we found it was an issue in our html header.

FB like, the XFBML method is now working beautifully, and you can see it here as an example.

I would like to retract my previous comments and say that the MSU system was not in anyway responsible for the issue we had.

Regarding the SEO URLS, all I can say is that our business increased by 400% the month after we started using them.

The figures speak for themselves.

Can you please kindly post the instruction/code for implementing the XFBML version of the Like button? Thanks!

1 Sep 2010, 12:01 AM
#60
elemi avatar

elemi

Zen Follower

Join Date:
Mar 2006
Location:
Auckland, New Zealand
Posts:
242
Plugin Contributions:
0

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

shanesoine:

That looks like a really good idea but I only want the facebook likes link to appear on my landing/main page preferably in the righthand sidebox area - where would I put the code in this case?

Ditto... I have way too many products to have it popping up left, right and centre!

Elemi

The Art of Bespoke Aromatherapy
https://www.AmorAromatherapy.co.nz