Facebook Comments
-
- Posts: 152
- Joined: Sun Jan 06, 2013 3:03 pm
Facebook Comments
This is pretty interesting and could well boost sales - Facebook Comments
Take a look at this page and then click on the comments tag
puchipetwear.com/collars-amp-leads/dog-leads/crown-jewels-dog-lead
I am going to look into this later on and find out how it is implemented.
Take a look at this page and then click on the comments tag
puchipetwear.com/collars-amp-leads/dog-leads/crown-jewels-dog-lead
I am going to look into this later on and find out how it is implemented.
Re: Facebook Comments
Code: Select all
http://developers.facebook.com/docs/reference/plugins/comments/
-
- Posts: 152
- Joined: Sun Jan 06, 2013 3:03 pm
Re: Facebook Comments
Thanks.
Looks pretty easy to implement too. Will see if I can do it properly this time and create a tab for it as well .
Looks pretty easy to implement too. Will see if I can do it properly this time and create a tab for it as well .
-
- Posts: 152
- Joined: Sun Jan 06, 2013 3:03 pm
Re: Facebook Comments
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:
2. then edited products.tpl by removing this:
and replacing it with this:
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:
2. then replaced this code:
with this:
Working on my site.
Example page:
apet4life.co.uk/dog-store/dog-coats/sherpa-leather-coat.html
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>
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 } ?>
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 } ?>
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:
Code: Select all
<?php if($review_status){
Code: Select all
<?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if($review_status){
Code: Select all
$Review_tabs = "<a><div class=\"tab_text\">".$tab_write." </div></a>";
Code: Select all
$Review_tabs = "<a><div class=\"tab_text\">".$tab_write." <fb:comments-count href=$url></fb:comments-count></div></a>";
Example page:
apet4life.co.uk/dog-store/dog-coats/sherpa-leather-coat.html
Last edited by Bluesplayer on Sat Mar 09, 2013 6:24 pm, edited 5 times in total.
-
- Posts: 152
- Joined: Sun Jan 06, 2013 3:03 pm
Re: Facebook Comments
I am trying to use this code:
right next to the review tab (currently displaying as comments). This will then display the number of comments on that page. I have tried all ways with javascript and php but failed. The code I have used earlier on to get the page url won't work higher up the product.tpl file for some reason so I can't use this:
.
I have tried messing with the product controller file by adding a function in there but that didn't work either. Any ideas?
Code: Select all
<fb:comments-count href=page url needed here/></fb:comments-count>
Code: Select all
<?php echo curPageURL(); ?>
I have tried messing with the product controller file by adding a function in there but that didn't work either. Any ideas?
Re: Facebook Comments
I assuming the comments are on the URL you are looking at. Is the count listed? If you, you can get the count similar to how we get currency. Look in the library/currency and you will see the code that retrieves currency conversions.
The same method should work here for you.
The same method should work here for you.
-
- Posts: 152
- Joined: Sun Jan 06, 2013 3:03 pm
Re: Facebook Comments
I have fixed it now. Going to update this post with the solution.Brent wrote:I assuming the comments are on the URL you are looking at. Is the count listed? If you, you can get the count similar to how we get currency. Look in the library/currency and you will see the code that retrieves currency conversions.
The same method should work here for you.
Thanks.
-
- Posts: 152
- Joined: Sun Jan 06, 2013 3:03 pm
Re: Facebook Comments
Looking good I think - check it out:
apet4life.co.uk/dog-store/dog-coats/sherpa-leather-coat.html
apet4life.co.uk/dog-store/dog-coats/sherpa-leather-coat.html
Re: Facebook Comments
Great .
Thanks.
Thanks.
Re: Facebook Comments
Thanks for the info related to social media