Magento - Setup Facebook Likes


Advertisements

Social networks such as Facebook, Twitter and Google Plus have become powerful for promoting the web shops. Facebook provides "Like" button which allows users to share contents of the products across the web.

The following steps show you how to add Facebook Like button for your Magento products −

Step 1 − Go to developer site of Facebook https://developers.facebook.com/docs/plugins/like-button and click on Get Code button.

Magento Setup Facebook Likes

Step 2 − When you click on the Get Code button, a window will get appear as shown in the following screen.

Magento Setup Facebook Likes

Step 3 − Open the file i.e. /app/design/frontend/base/default/template/productalert/product/view.phtml in the Magento and paste the below code around the line 50.

<div class = "fb-like" data-href = "https://developers.facebook.com/docs/plugins/" 
   data-layout = "standard" data-action = "like" data-show-faces = "true" 
   data-share = "true">
</div>

Step 4 − Go to the System menu and click on the Cache Management to refresh the cache.

Magento Setup Facebook Likes

Step 5 − Under Cache Storage Management section, select the items from the Cache Type column for which you need to refresh the cache. Select the Refresh option from the Actions field on the right hand corner and click on Submit button to refresh the cache.

Magento Setup

Step 6 − After refreshing cache, logout from your admin panel and re-login. Refresh your product view page to see the Facebook like button.

Advertisements