Implementation of the Facebook Like button on each product page

Hello,



I have followed the examples om this thread and tried most of them.

Most of these solutions were showing on Facebook the main page of my site even though I was clicking the “Like” button from a product details page.



The solution that did the trick for me (I have SEO enabled) was:




Unfortunately, the photo posted with this on Facebook is wrong. The image is from the "captcha" functionality ..

Can anyone post a solution on hoe to get the product thumbnail sent to facebook when clicking the "Like" button?

Thank you in advance!

Hi,



I’ve added this code to “default_template.tpl” file from skins area.




The like button is posted, I can click and add a comment that appears on facebook with the proper url but with the wrong picture!
I get the captcha picture instead of the product thumbnail.

Can anyone help please?

Thank you!

[quote name=‘Lee Li Pop’]Hello All,



Thank you for your help.



1 - First of all, you need to go to this page to use the configurator to select the look and feel you want and to get code to add to your site:



[url]http://developers.facebook.com/docs/reference/plugins/like[/url]



2 - Here is the product URL in CS-Cart 2.1.2, of course, change “YOURWEBSITE.COM” with your real website URL!:


http://YOURWEBSITE.COM{"products.view?product_id=`$product.product_id`"|fn_url}
```<br />
<br />
3 - No need to jeopardize your meta tags or anything else in your header "index.tpl" it works fine without, in standalone!<br />
<br />
4 - Here is my own code, of course, change "YOURWEBSITE.COM" with your real website URL!:<br />
<br />
```php
<iframe src="http://www.facebook.com/plugins/like.php?href=http://YOURWEBSITE.COM{"products.view?product_id=`$product.product_id`"|fn_url}&layout=box_count&show_faces=true&width=120&action=recommend&colorscheme=light&height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:120px; height:65px;" allowTransparency="true"></iframe>
```<br />
<br />
5 - I pasted it on line 19 of "default_template.tpl" to have my "Like" Facebook button under the product image:<br />
<br />
<br />
<br />
![](upload://8KjfQMmX1HhXDuR2absDZvUrCRC.jpeg)<br />
<br />
That's all folk's!<br />
<br />
<br />
Lee Li Pop[/QUOTE]<br />
<br />
Hi Lee Li<br />
<br />
I pasted the code as specified in Line 19 of default_template.tpl but the Like button does not show.<br />
<br />
Using 2.1.4<br />
<br />
Any idea ?

Hello JGift,


[quote name=‘JGift’]Hi Lee Li



I pasted the code as specified in Line 19 of default_template.tpl but the Like button does not show.



Using 2.1.4



Any idea ?[/QUOTE]



Be aware, I use 2.1.2, and I tweak a lot my skin. For sure, you need to try another line of code.



My advices can’t be fit for all, because changes from one version to another and from one skin to another are too differents. So, the advice that I bring to the CS-Cart’s comunity can’t be universal.



I hope you understand that I am sincerely sorry for not being able to help you more.





Lee Li Pop

[quote name='Lee Li Pop' timestamp='1305574571' post='112453']

Hello JGift,









Be aware, I use 2.1.2, and I tweak a lot my skin. For sure, you need to try another line of code.





My advices can't be fit for all, because changes from one version to another and from one skin to another are too differents. So, the advice that I bring to the CS-Cart's comunity can't be universal.





I hope you understand that I am sincerely sorry for not being able to help you more.







Lee Li Pop

[/quote]



Hi Lee Li,



Thanks for the instructions. Were you able to work out how to get the correct product image to be displayed in the 'like' post? When I 'like' a product, it picks up and displays an image that is part of my skin.



Kind Regards,



James

i am at the same place too, not sure how to add addthis code to my site…HELP anyone

[quote name='Astroboy' timestamp='1316728500' post='122141']

i am at the same place too, not sure how to add addthis code to my site…HELP anyone

[/quote]



what i did and worked for me…



i copied-pasted the code from addthis on line 112 right after



in skins\basic(or your skin template)\customer\blocks\product_templates\default_template.tpl file



This brought addthis button right after the product picture and above description and tabs.

[quote name='vva11' timestamp='1305460844' post='112312']

Hello,



I have followed the examples om this thread and tried most of them.

Most of these solutions were showing on Facebook the main page of my site even though I was clicking the “Like” button from a product details page.



The solution that did the trick for me (I have SEO enabled) was:




Unfortunately, the photo posted with this on Facebook is wrong. The image is from the "captcha" functionality ..

Can anyone post a solution on hoe to get the product thumbnail sent to facebook when clicking the "Like" button?

Thank you in advance!
[/quote]

this did the trick for me with the right image sent to facebook.
i will use it as i can't use the facebook addon cause facebook don't allow me to get an App ID yet.(i dont know why,but i am searching it)

finally with the wrong images sorry…

maybe we have to do something in meta.tpl

Don't know.

Make sure you don't have an overwrite for your meta.tpl file.



for example, if you have cscartrocks canonical url add-on, you need to edit skins/YOUR_SKIN/customer/addons/canonical_url/hooks/index/meta.override.tpl



I still don't get why you guys don't use cs-carts facebook add-on btw… works like a charm on all my sites… I did have to edit the file I mention above though.