AlegroCart open source E-commerce
Web hosting by Host1Plus

Facebook Comments

General discussion about AlegroCart - Post here if you can't find another suitable forum

Facebook Comments

Postby Bluesplayer » Sat Mar 09, 2013 5:30 am

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.
apet4life.co.uk
Bluesplayer
 
Posts: 152
Joined: Sun Jan 06, 2013 3:03 pm

Re: Facebook Comments

Postby leo » Sat Mar 09, 2013 8:26 am

Code: Select all
 http://developers.facebook.com/docs/reference/plugins/comments/
User avatar
leo
admin
 
Posts: 4215
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Facebook Comments

Postby Bluesplayer » Sat Mar 09, 2013 8:32 am

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 :ugeek: .
apet4life.co.uk
Bluesplayer
 
Posts: 152
Joined: Sun Jan 06, 2013 3:03 pm

Re: Facebook Comments

Postby Bluesplayer » Sat Mar 09, 2013 2:45 pm

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 :D . 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){


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
Last edited by Bluesplayer on Sat Mar 09, 2013 6:24 pm, edited 5 times in total.
apet4life.co.uk
Bluesplayer
 
Posts: 152
Joined: Sun Jan 06, 2013 3:03 pm

Re: Facebook Comments

Postby Bluesplayer » Sat Mar 09, 2013 4:32 pm

I am trying to use this code:

Code: Select all
<fb:comments-count href=page url needed here/></fb:comments-count>


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:

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?
apet4life.co.uk
Bluesplayer
 
Posts: 152
Joined: Sun Jan 06, 2013 3:03 pm

Re: Facebook Comments

Postby Brent » Sat Mar 09, 2013 5:44 pm

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.
User avatar
Brent
Site Admin
 
Posts: 4365
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Facebook Comments

Postby Bluesplayer » Sat Mar 09, 2013 5:48 pm

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.


I have fixed it now. Going to update this post with the solution.

Thanks.
apet4life.co.uk
Bluesplayer
 
Posts: 152
Joined: Sun Jan 06, 2013 3:03 pm

Re: Facebook Comments

Postby Bluesplayer » Sat Mar 09, 2013 6:03 pm

Looking good I think - check it out:

apet4life.co.uk/dog-store/dog-coats/sherpa-leather-coat.html
apet4life.co.uk
Bluesplayer
 
Posts: 152
Joined: Sun Jan 06, 2013 3:03 pm

Re: Facebook Comments

Postby readsilk » Sun May 19, 2013 9:40 pm

Great .
Thanks.
readsilk
 
Posts: 3
Joined: Mon Aug 01, 2011 10:14 pm
Location: China qingdao


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron