Jump to content
tomerg3

[MODULE] Facebook Like - Add a Facebook Like button to the product page or any other location

Recommended Posts

This module adds a Facebook Like button to the product page.

You can configure the size, type, show faces, font, color, and text of the button.

Works in Multiple Languages.

Disables the button for Search Engines.

Uses the XFBML method.

You can also display it anywhere you want using a new hook.

Tested on PrestaShop 1.4, 1.5 and 1.6.x

View the product here: http://www.presto-ch...ike-button.html

 

Direct download: http://www.presto-changeo.com/attachment.php?id_attachment=11

V1.0.1 released, bug fix for minimum width of compact button

V1.1 released, it includes

* XFBML method.
* Support for multiple languages for button text.
* Uses the default product image.
* Disabled for search engines

When upgrading to this version, uninstall the module and install it again

V1.1.1 released, it includes

* Support for SSL (include the facebook JS file using https when enabled).
* Hide JS code from search engines.

V1.1.2 released, it includes an override file for the custom facebook hook in PS 1.4

V1.2 released, it includes support for the new "send" button.

V1.3 released, it includes
* Google Analytics log of events (Like, Unlike, Send)
* Better formatting.


V1.4 Released
* Updated Facebook API code (fixes potential clashes with other facebook plugins).
* Optimized automatic upgrade code.

 

V1.5 
Support for PS 1.5


V1.5.1 
Fix for new custom hook system in PS 1.5.5+

 

V1.6 Released
Optimized for PrestaShop 1.6

post-20153-0-98732200-1403620559_thumb.png

post-20153-0-85271900-1403620563_thumb.png

  • Like 7

Share this post


Link to post
Share on other sites

great;
thanks for works,

Share this post


Link to post
Share on other sites

My pleasure.

Be sure to click the Like button on the module page ;)

Share this post


Link to post
Share on other sites
My pleasure.

Be sure to click the Like button on the module page ;)

ok; :)
I do

Share this post


Link to post
Share on other sites
Awesome work as always Tomer!

Is there any way to move it to the bottom under "Print" and "View Full Size"... see my site: http://www.affordablefiberoptics.com/four-fiber-dielectric-hfoc-sca-jumper/199-four-fiber-dielectric-hfoc-sca-jumper.html

Thanks as always.
Patrick


Looks like you got it, if anyone else needs it:

Modules->Positions-> Display non-positionable hook-> Extra actions on the product page (left column)

Share this post


Link to post
Share on other sites

The Facebook Like module has its own section and cannot be moved.

I've tried moving the other items down... that didn't help either.

Am I stupid or simply missing something?

Thanks!

Share this post


Link to post
Share on other sites

Hmm, that's odd, it's a part of "extra left" hook, but it also comes with a custom hook, you can follow the instructions in the module configuration page
and place the new hook anywhere you want.

Share this post


Link to post
Share on other sites

Excellant module again Tomerg3, just need to be able to track all the people who click like on the products.

Share this post


Link to post
Share on other sites

Tomerg if this was added to hookheader instead of the extra actions would it perform the same, but it would be added into every page including categories,home,manufacturer etc?

Share this post


Link to post
Share on other sites
Excellant module again Tomerg3, just need to be able to track all the people who click like on the products.

me too. :-)

Share this post


Link to post
Share on other sites
Tomerg if this was added to hookheader instead of the extra actions would it perform the same, but it would be added into every page including categories,home,manufacturer etc?


I have added the option to use a new hook for this (hookFacebookLike), you can change it to hookHeader in line 192 of facebooklike.php if you don't want to use the new hook that I created.

Tomer.

Share this post


Link to post
Share on other sites

thanks tomerg3! it is great module. I have a question - after installation, how can I remove the default "face book like"? I have follow the optional installation I have put it on somewhere else. But now I got double "face book like". I can't remove the default one. thanks

28068_CeeBgcnFOpSXI6jH9Hvq_t

Share this post


Link to post
Share on other sites

Goto Modules->Positions-> check the "Display non-positionnable hook" box and look for "Extra actions on the product page (left column)"

Share this post


Link to post
Share on other sites

What am I doing wrong? When someone likes a product, it says on his FB profile. "John Doe likes Awesome product at My shop ip address" instead of My shop name.

Brilliant module by the way, thanks a lot :)

Share this post


Link to post
Share on other sites

The module with send to facebook the current URL that is in the browser ($_SERVER['HTTP_HOST']), so people must be accessing your site using the ip address

Share this post


Link to post
Share on other sites
This module adds a Facebook Like button to the product page.

You can configure the size, type, show faces, font, color and text of the button.

You can also display it anywhere you want using a new hook.

It is compatible with Prestashop 1.1, 1.2 and 1.3

http://www.presto-changeo.com/prestashop-free-modules/45-facebook-like-button.html

V1.0.1 released, bug fix for minimum width of compact button


great work bro...
but.. how can i download the nmodule?

Share this post


Link to post
Share on other sites

You need to go through the shopping cart at his page. No worries - it's free.

Also, awesome work, I like this little thing, even tho I'm not much of a Facebook person. A lot of my friends are and when I get my shop back up and going (switching to prestashop currently, so I need to stock my store and set things up), they'll be clicking that like button to help me get traffic. =D

Share this post


Link to post
Share on other sites

Hi tomerg3 - good work on the module!

Just wondering do you know if it's possible to send anything other than the link of the page to facebook - e.g. Using the Product Name and the link to it? I thought I read you could do it with WordPress but I might be wrong - if not, this would be MEGA to have!! ;)

Share this post


Link to post
Share on other sites

hey great mod. i just installed it last night worked good then and today where the link was is now just says SERVICE. i did an uninstall and reinstall and nothing.

Thanks
Jeff

Share this post


Link to post
Share on other sites

It's controlled by facebook, there may be something else going on, but without a link to the page on your site, there's not much I can do...

Share this post


Link to post
Share on other sites

Not sure why (other than the fact that mac = apple = crap).

It works fine here, either way, you are getting the content from the facebook site (since it's in an iframe), so my module has no control over what comes back.

Share this post


Link to post
Share on other sites

The facebook servers crashed worldwide and was totally unavailable, that is probably why it wasnt working correctly

Share this post


Link to post
Share on other sites

It shows up on my product page (though I can't seem to get it to change location from in between 'Send to a friend' and 'print'), but when anyone clicks on the "Like" button it displays this:

You like this.Unlike · Error


The Error slides out and it is in RED, *but* the link does show up on Facebook.

I re-uploaded all of the files, made sure they are there, and all is well with that, so what is going on? Can anyone tell me what to fix or look at?

Share this post


Link to post
Share on other sites

Thank you, that was helpful in clearing up the error. :)

Share this post


Link to post
Share on other sites

Am I doing something wrong? I unzipped the .tar file, uploaded the content files to modules via ftp and it shows in BO but nothing on the front office. Every Facebook module I have tried now with exactly the same reults, what's wrong?


- Sorry - posted too early, added the module through BO and works fine now. :)

Share this post


Link to post
Share on other sites

Spoke too early :)

How can I alter the text/ language - I have looked in all the files and the text and image isn't here. I have the problem that it has the 'Like' button in Estonian (meeldib) and the the text 'be the first of your friends to like this' in English.

How can I change it to make one Estonian and one english version?

Share this post


Link to post
Share on other sites
It shows up on my product page (though I can't seem to get it to change location from in between 'Send to a friend' and 'print'), but when anyone clicks on the "Like" button it displays this:
You like this.Unlike · Error


The Error slides out and it is in RED, *but* the link does show up on Facebook.

I re-uploaded all of the files, made sure they are there, and all is well with that, so what is going on? Can anyone tell me what to fix or look at?




WoW the facebook, Twitter ect. buttons look very sweet on youre site. how did you do that?

Share this post


Link to post
Share on other sites

Looked in back office, tools, translations and there is nowhere to change the text in the widget button or the 'be the first of your friends to like this' text - so it is a one language pony?

Share this post


Link to post
Share on other sites

Facebook uses an iFrame to display the button, which means that the content is entirely in their control.

The language it determined by the setting of each customer the visits your site.

Share this post


Link to post
Share on other sites

Actually weird is that it has Estonian language tab in IE but in Firefox it is english - And I haven't changed anything. How can I fix it? SOmeone must know - is this thread monitored by the designer of the module at all?

Share this post


Link to post
Share on other sites

I just told you the answer in the previous post (#38).

I'm not sure how I can be more clear about it, the button and the text next to it are NOT A PART OF PRESTASHOP! They are being generated by Facebook on their server, THERE IS NO WAY TO CHANGE IT.

Share this post


Link to post
Share on other sites

No need to shout mate - apologies - I didn't see your answer - I posted one after the other. I get your point that it is controlled by Facebook and I m just trying to understand how it works.

So, I am sitting in Estonia and I have Google Chrome, Firefox and IE open on my laptop - yet Chrome and Firefox shows English and IE Estonian - how can that work, it doesn't make sense? If they were all Estonian (because of my IP address, then it would make sense).

I know literally nothing about the technical, I am just trying to make a business. So I wouldn't know an iframe from a hole in the ground. That's why I'm a regular and you're a moderator.

Will it be so that if someone in the UK checks my site they will definitely see an English text 'Like' on the button and in Estonia you will 'Meeldib' or it can be so that the UK can also get 'Meeldib'. I hope you understand my point in that I don't want an English speaking person to see the facebook button in another language. And since I can't seem to check it (with two browsers giving me different results) how can I know? How does it work?

Share this post


Link to post
Share on other sites

As I said before, I'm pretty sure that the language is determined by your facebook account, if your default language in facebook is English, then you will see the button in English

Share this post


Link to post
Share on other sites

I think if the browser settings are in one language/region then it will display accordingly. But it cannot 'know' a persons' facebook settings before the person clciks the button or logs in, that's impossible. But thanks anyway.

Share this post


Link to post
Share on other sites

Hi.

I have a problem with the "likes" disappearing. Say a product has 1 like, it only lasts for a limited time and then it looks like nobody likes the product. I know what you're thinking, that somebody just clicked "unlike" :) But that's not the case, I've tested it lots of times and the likes don't stick.

Share this post


Link to post
Share on other sites

Hello,

I'm Sorry. I am a stupid.
I dunno how to "Add {$HOOK_FACEBOOK_LIKE} in the tpl file you want it to show. "

and should I add
"Add 'HOOK_FACEBOOK_LIKE' => Module::hookExec('facebookLike'), to /header.php below HOOK_TOP around line #15. "
to the header.php if I want to place the "like" to extra right??

Thanks for your help.

Share this post


Link to post
Share on other sites

Great module, everything works perfectly with one exception, the product picture that appears in my facebook account is wrong, its the picture from another product, any ideas?

Share this post


Link to post
Share on other sites

No idea, the module only sends the URL, the image is picked up by facebook directly.

Share this post


Link to post
Share on other sites

V1.1 released, it includes

* XFBML method.
* Support for multiple languages for button text.
* Uses the default product image.
* Disabled for search engines

When upgrading to this version, uninstall the module and install it again

Share this post


Link to post
Share on other sites

hi-

i'm having problems installing this module. i have version prestashop v 1.2 and i tried both uploading a zipped version of the module in the BO and also copying the contents directly into my server. in the BO, i get error messages and when i copy through server, nothing shows up on my webpage. am i missing a step?

Share this post


Link to post
Share on other sites

Tomer - module is working great - good work.

persephonevintage - what errors are you seeing? This is a pretty straight forward install normally - did you install it to your module directory?

Share this post


Link to post
Share on other sites

yes, i installed it into my module directory. then i put the hook tags indicated into header.php and product.tpl, where i want to put the button. but the button doesn't show up. i then tried moving the position of the module in the back office and i finally got it to show in the main page of my website when i moved it to "homepage content" but that's not where i wanted the button.

i have a feeling it's a small step i may be skipping? thanks in advance for your reply.

Share this post


Link to post
Share on other sites

I used it in default mode - ie shows under products - have you tried to leave it as default - and does it show then?

I would download it again - unzip it, and FTP it back to your modules directory. Remove the original file from your modules first. Corruption message etc so definitely worth re-downloading.

The only thing I am not sure is the version you are using - ie is it compatiable etc. Worth checking the notes I guess.

Do you have a link to your site?

Share this post


Link to post
Share on other sites

mmm not sure tbh. I checked your source code versus mine - and you seem to have a few less instances - but that does not mean that is the problem, I use a seperate facebook mod for my main page - so that's probably why.

It maybe a layout issue - but I am no expert in themes etc. Have you tried with the default theme?

Share this post


Link to post
Share on other sites

Looks like your theme is missing the default hook (extraLeft).

Try adding {$HOOK_EXTRA_LEFT} in product.tpl where you want the button to show.

Share this post


Link to post
Share on other sites

I have the problem that on facebook show wrong image.

I have just update to the version v1.1 but i got the same problem.

Share this post


Link to post
Share on other sites

Did you uninstall before installing the new one?

FB uses caching, try it on a product that you did not "Like" before.

Share this post


Link to post
Share on other sites

Yes, i have unistalled it... could you please try and told me if is correct


Thanks

Share this post


Link to post
Share on other sites

me again.

so the facebook button worked for a while but suddenly, it disappeared. not sure why. it first only disappeared when i used firefox but now it's gone when i use any browser. does anyone have any idea why and how to fix it?

Share this post


Link to post
Share on other sites
Also to me are disappeared all the button, do you know why?



Same here

Share this post


Link to post
Share on other sites

Someone attach module zip file to forum, i can't download in Presto web. Thank

Share this post


Link to post
Share on other sites

Great module!

Is it possible to position the module so, that it is next to the Twitter button?
Just were the red box is?

If it is possible, please tell me how :).

41286_vdXoSBV2zvtDgcUZ6WW3_t

Share this post


Link to post
Share on other sites

V1.1.1 released, it includes

* Support for SSL (include the facebook JS file using https when enabled).
* Hide button + JS code from search engines.

Share this post


Link to post
Share on other sites

I just installed the module. But i have a problem. As you can see in the picture there is a space between the text. What could be the problem that facebook like button doesnt show up ?

41721_yXya9udtpQ0gV7ImCAqN_t

Share this post


Link to post
Share on other sites

An image is worth a 1,000 words, a link is worth a lot more ;)

Share this post


Link to post
Share on other sites

I fix the problem above. It was a conflict with facebook fan module that i downloaded recentlly. But know i have another problem. Here you can see in the picture, can someone help me ? I could give a link but my website know is on wamp server.

41733_FAvsKqKXcEpmP37brIcm_t

Share this post


Link to post
Share on other sites

Hi i have added {$HOOK_FACEBOOK_LIKE} and 'HOOK_FACEBOOK_LIKE' => Module::hookExec('facebookLike'), and i can see the facebook like button moved to the location i want. I then deleted the default button from the extra actions left column. All works seem fine. But i am still getting the red Error when i click on the like button.

Could you help? i have read the Post 13 and 14. but not work either.
I am using V1.1.1 from http://www.presto-changeo.com/en/prestashop-free-modules/45-facebook-like-button.html for prestashop 1.3.7

-- UPDATE

1) It is successfull if i do like this,

<iframe src="http://www.facebook.com/plugins/like.php?href=http://MyURL.com&layout=standard&show_faces=false&width=450&action=like&font=verdana&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>

However, the above is already post a static url as MyURL.com to my facebook. I would like the url to be dynamic according to the current product page viewed. so that facebook will show the particular product which the customer like. "<iframe src="http://www.facebook.com/plugins/like.php?href=.." how to make this dynamic?

2) Also, i observed that whenever i click LIKE, my facebook wall will delete the previous product which i like and moved that to the top as the new one.

3) How to get the exact image which i like to be display to the facebook?what i got is always the same picture on every page that i click Like.

Share this post


Link to post
Share on other sites

i tried this too, but failed with error also



<iframe src="http://www.facebook.com/plugins/like.php?href={php} echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; {/php};layout=standard&show_faces=false&width=450&action=like&font=verdana&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>

Share this post


Link to post
Share on other sites
i tried this too, but failed with error also



<iframe src="http://www.facebook.com/plugins/like.php?href={php} echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; {/php};layout=standard&show_faces=false&width=450&action=like&font=verdana&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>

The problem is the Canonical URL v1.3 Module. Uninstall it and problem solved

Share this post


Link to post
Share on other sites

same. The Canonical URL is uninstalled but still the same problem after even ctrl F5
i have even turn off the friendly url but stiill getting errors.

please advice.

Share this post


Link to post
Share on other sites
same. The Canonical URL is uninstalled but still the same problem after even ctrl F5
i have even turn off the friendly url but stiill getting errors.

please advice.


Use the facebook like module instead of adding the line in product.php. Delete the facebook line and install Facebook Like v1.1.1 module.

Share this post


Link to post
Share on other sites

I cant seem to place this:
'HOOK_FACEBOOK_LIKE' => Module::hookExec('facebookLike'),

It said that it should be placed in header.php at Line 15.

But header.php only shows $controller = new FrontController(); $controller->displayHeader(); and a lot of comments.

I'm using 1.4.

Share this post


Link to post
Share on other sites

I will release a new version soon with the modification for PS 1.4

Share this post


Link to post
Share on other sites

V1.1.2 released, it includes an override file for the custom facebook hook in PS 1.4

Share this post


Link to post
Share on other sites

Ok..I downloaded the Facebook LIKE module and installed it....NOW...how do I get it
on the page that I want it to be on..
Thanks, Newbie here

Share this post


Link to post
Share on other sites