This will add a dynamic FB like button to all virtuemart products. Using VM 2.0.12F / Joomla 2.5.7
1. Setup /yourtemplate/html/com_virtuemart/productdetails/default.php Make sure you have this template override selected in your shop config.
2. Below approx line 260 <?php echo $this->product->product_desc; ?> </div>
ADD -
<fb:like id="fb" href="http://www.yourdomain.com" layout="button_count"></fb:like>
<script type="text/javascript">
var sUrl = window.location;
document.getElementById('fb').setAttribute('href', sUrl);
</script>
3. Go to your template/index.php directy below body tag add:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '135372606562726', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
Check your Product pages.