gopinathgoswami, in regards to the Facebook Open Graph tag in includes/templates/<your_custom_template/common/html_header.php
HTML Code:
<meta property="og:url" content="<?php echo $prod_url; ?>" />
I suggest using the canonical link if it's available thus:
PHP Code:
if (isset($canonicalLink) && $canonicalLink != '') {
$prod_url = $canonicalLink;
}
else
{
$prod_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
This is because the original code will include the "&zenid=" field if it happens to be in the URL.
And for the Facebook like button code in individual product pages, I think there needs to be a "href" field in the link:
HTML Code:
<!--bof Facebook Like button code-->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=YOUR-APP-ID";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:like send="true" width="450" show_faces="true" href="<?php echo $prod_url; ?>"></fb:like>
<!--eof Facebook Like button code-->
If the FB Like button is the general like button for your website, I think it's a good idea to link it back to your website's Facebook page. Let's say the address of your website's Facebook page is "http://www.facebook.com/yourWebsite", then the general like button for your website should include the href to point to this.
HTML Code:
<fb:like send="true" width="450" show_faces="true" href="http://www.facebook.com/yourWebsite"></fb:like>
Without this href, I found that the likes were being counted, but there's no where on Facebook that "collects" the likes and you can't see who's liked your page.
Hope I haven't gotten the wrong end of the stick to this whole thing.
Bookmarks