Tag: facebook like

Add A Facebook Like Button

A while ago, Facebook created the Facebook Like Button that works by using an iframe of FBML. The Like button allows you to easily get some free social media coverage with consumers.

Many websites and blogs are making use of the Facebook Like button and any other ways possible of sharing on social media networks because the cost is so minimal and publicity is so important to any business.

Adding the button is extremely simple, although it does require some editing of .phtml files, an ftp client, or experience with VI or EMACS if you have SSH access.

Step 1: Open up app/design/frontend/default/{{YOURTHEMENAMEHERE}}/template/catalog/product/view.phtml

Step 2: Search for the following code.

getReviewsSummaryHtml($_product, false, true)?>
getChildHtml('alert_urls') ?>

Step 3: Paste this code between the two lines of above code.

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $_product->getProductUrl(); ?>&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>

Step 4: Open up your website and view a product. If you can’t see the Facebook Like button you may need to clear the Magento Cache.

Hope this helps and good luck with your business!