I want to thank Kevinwood for great tutorial.
But I met with the plugin the following problem:
When the user is in an inside page and then enters in his/her account, it doesn't stay on the same page, where he/she was. The web-site forwards the user to a web-page, which says, that he is already in the registered users part.
Furthermore, I don't want the description of products in Facebook to use $product_s_desc.
Having tried several different plugins, I decided that there must be an easier way to add buttons.
So here's an easy way to add buttons like "Like" and "Send":
flypage.tpl.php<?php
$doc =& JFactory::getDocument();
$current_url = JURI::getInstance();
$current_url_string = ($current_url->toString() );
$doc->addCustomTag( '<meta property="og:title" content="' . $product_name . '"/>' ); // product name
$doc->addCustomTag( '<meta property="og:type" content="product"/>' ); // type of products
$doc->addCustomTag( '<meta property="og:url" content="' . $current_url_string . '"/>' ); // product page
// get product image START
$db->setQuery("SELECT product_thumb_image FROM #__vm_product WHERE product_id = " . $product_id );
$db->query();
$image = $db->loadResult();
if ( $image ) {
$imgurl = JURI::base() . "components/com_virtuemart/shop_image/product/" . $image;
$doc->addCustomTag( '<meta property="og:image" content="' . $imgurl . '"/>' );
}
// get product image END
$sitename = $mainframe->getCfg('sitename'); //get site name
$doc->addCustomTag( '<meta property="og:site_name" content="' . $sitename . '"/>' ); //or what you want
$doc->addCustomTag( '<meta property="fb:admins" content="XXXXXXXXXXXXXXXXXXX"/>' ); // from facebook!
$doc->addCustomTag( '<meta property="og:description" content="' . $product_s_desc . '"/>' ); //or what you want
?>
<div id="fb-root"></div>
<!-- appId=XXXXXXXXXXXXXXXX is your application ID from Facebook! -->
<script src="http://connect.facebook.net/en_US/all.js#appId=XXXXXXXXXXXXXXXX&xfbml=1"></script><fb:like send="true" width="490" show_faces="false" font="arial"></fb:like>
You can see how some of the products look at
www.vspc.bgBest regards
Venci