Reputation: 1693
I'm trying to add a Facebook "Like" button and I'm using a free extension for it but it's giving me an error as they are not compatible with Magento version 1.5.
I'm trying to do it manually but a little help which I found was to get a Facebook developer code and paste in static URL etc.
...but I didn't understand that.
So can you kindly tell me how to do what I want? From where do I get which code and where to paste please?
Upvotes: 1
Views: 16299
Reputation: 11
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8&appId=157602984730324";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like"></div>
Upvotes: 1
Reputation: 128
Try this for product detail page
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=181097698614858&xfbml=1"></script>
<fb:like href="<?php echo $_product->getProductUrl() ?>" send="false" show_faces="false"></fb:like>
Upvotes: 0
Reputation: 11
It is always advisable to use an module. There is a 3-in-one module available for Social sharing. i.e. Google+1 Button, Facebook LIke and Twitter Share.
you can check it at magento connect http://www.magentocommerce.com/magento-connect/Modulesoft/extension/7258/google_1_plus_button_with_facebook_and_tweet
Hope the information is helpful
Upvotes: 1
Reputation: 2183
<iframe src="http://www.facebook.com/plugins/like.php?href=http://yoursite.com?other_params_go_here"></iframe>
If you want the url to be the current one:
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $this->helper('core/url')->getCurrentUrl(); ?>?other_params_go_here"></iframe>
Upvotes: 2
Reputation: 327
you need login Facebook account panel & create your own code for your website then you can paste code in any block template . if you can not template you can login magento admin panel to enable development mode
Upvotes: 1
Reputation: 952
I added a Facebook plugin at a front page, see it here: http://www.boardcorner.se on the right side. By adding a piece of code in the TinyMCE javascript it allows the Facebook iframe to be inserted by a standard copy & paste. You'll find the piece of code needed here: Magento - How to allow certain tags (iframe, embed) in Magento's CMS editor?
Upvotes: 0