I have implemented this at the cost of reviews. Going by my experience with my others sites very few people will bother writing a review and really what is there to write about with regard to pet products? A comment is as good as usually and gets more attention. To convert the reviews to Facebook comments was quite easy. This is how I did it:
1. edited template layout.tpl and added this above the </body> tag:
Code: Select all
<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_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
2. then edited products.tpl by removing this:
Code: Select all
<?php if($review_status){?>
<div class="review_write"><br><a href="<?php echo $write; ?>"><img src="catalog/styles/<?php echo $this->style?>/image/write.png" alt="<?php echo $text_write_short; ?>"></a><br><br>
<a href="<?php echo $write; ?>"><?php echo $text_write; ?></a></div>
<?php } ?>
and replacing it with this:
Code: Select all
<?php if($review_status){?>
<div class="review_write">
<?php $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>
<div class="fb-comments" data-href="<?php echo $url; ?>/" data-width="470" data-num-posts="10"></div>
</div>
<?php } ?>
3. then I altered the language controller product.php file by altering 'tabs tab_write' to 'Comments' and also by altering 'reviews text_empty' by deleting the contents of.
What the above does is get the current url of the page and allocates it to the Facebook comment code which is needed to make the comments unique and also for them to work once posted to Facebook.
Working now
. And Facebook is visiting the site a lot now too which might help with getting the site ranked.
My pages are developing nicely now with my new 'Sizes & Measuring' tab and now 'Comments':
apet4life.co.uk/diamond-quilted-leather-collars.html
Nice and neat plus informative
.
UPDATE
To get the comment count showing next to the tab comment title I did this:
1. edited the product.tpl file where it shows this:
I added code so that it became:
Code: Select all
<?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if($review_status){
2. then replaced this code:
Code: Select all
$Review_tabs = "<a><div class=\"tab_text\">".$tab_write." </div></a>";
with this:
Code: Select all
$Review_tabs = "<a><div class=\"tab_text\">".$tab_write." <fb:comments-count href=$url></fb:comments-count></div></a>";
Working on my site.
Example page:
apet4life.co.uk/dog-store/dog-coats/sherpa-leather-coat.html