Posts Tagged ‘Facebook’

Magento : Add a Facebook LIKE button in product view page

As we all know, There have many Magento extensions for social bookmarking services. But if you want to add just single Facebook like button in product view page then read following steps :

1. Open your Magento project directory then GO to app/design/frontend/default/template/catalog/product/ and open view.phtml file.

2. Add the following code snippet where you want to show Facebook LIKE button on view.phtml page.

<!--Facebook like button code starts here  -->

    <?php $CurrentUrl = urlencode(Mage::helper('core/url')->getCurrentUrl()); ?>
    
   <iframe src="http://facebook.com/plugins/like.php?href=<?php echo $CurrentUrl; ?>&layout=button_count&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=21"  
 schrollowing="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px" allowTransparency="true"> </iframe> 

<!--Facebook like button code ends here  -->

3. Save it. Now open product detail page, you should see Facebook Like button.

Enjoy :)