Jump to content
Latest News: (loading..)

Recommended Posts

Support thread for Facebook Comments addon v2.3.4.1 CE

A simple addon to let you place a facebook Comments widget on your product information pages.

Again totally standalone with no code change. Simply copy all files into relevant sections and go to admin modules /content and install “facebook Comments ”.

You need to edit one file to put your own website URL so comments are linked to your site. includes/modules/content/product_info/templates/tpl_cm_facebook_comments.php

<!---------------------------put your own website in here----------------->
<div class="col-sm-<?php echo $content_width; ?> cm-pi-facebook_comments">
<div class="fb-comments" data-href="www.yourwebsite.co.uk" data-width="400" data-numposts="5"></div>
</div>

It has been tested on the v2.3.4.1 CE and should just work. You can place it on the product info page like any other item just set it up in admin.

 

facebook.jpg


 

Share this post


Link to post
Share on other sites

Dear Zahid , @JcMagpie

Another excellent addon, you are a genius! I try it and it works OK.
The only disadvantage is that it adds comments to the global site, so the comments are the same in each product.

Is it possible to change the data-href parameter to each product page so the customers can comment about each single product?

looking in the forum I found this code, but I think we have to adjust it ....

data-href="<?php echo urlencode(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false)); ?>"

 

Opinions are heard.

Best regards

Valqui

 

 


I'm using oscommerce Edge v2.3.4.1

Get here the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

Share this post


Link to post
Share on other sites

change the FILENAME_PRODUCT_INFO to a hard coded 'product_info.php' change the $HTTP_GET_VARS to $_GET


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites

I don’t use facebook so I just used the recommended default setting given by facebook. If it will auto detect and comment per page let me know and I will update the app.


 

Share this post


Link to post
Share on other sites
12 hours ago, valquiria23 said:

Dear all, how are you?

Can someone help and say what changes should be made to the PHP code above so a single URL is formed per product info?

 

Best regards.

Valqui

Use dynamic URL instead. Can you try this and see if it works? I don thave facebook account so can not test.

<!-----------------------------------------------------put your own website in here----------------->
<div class="col-sm-<?php echo $content_width; ?> cm-pi-facebook_comments">
  <div class="fb-comments" data-href="<?php echo 'https://'. $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?>" data-width="400" data-numposts="5"></div>
 
    </div>
 


 

Share this post


Link to post
Share on other sites

Ok this is embarrassing apparently I do have a facebook account! Just tested and works comments only appear on page they are placed on. So use this to dynamicly get url.

<div class="fb-comments" data-href="<?php echo 'https://'. $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?>" data-width="400" data-numposts="5"></div>

 

:unsure: looks like I have had it for years and never known!


 

Share this post


Link to post
Share on other sites

Hello Zahid , I hope you are very well!

Yes. now I can leave different comments on each product !!!

But if in the first comment I get the error: "Object Missing a Required Value". Then I refresh the page and in the following comments the error does not appear.

How can this META can be added to the addon so that I can manage the comments?

<meta property = "fb: admins" content = "{YOUR_FACEBOOK_USER_ID}" />

Best regards

Valqui


I'm using oscommerce Edge v2.3.4.1

Get here the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

Share this post


Link to post
Share on other sites

Try on my test website so I can see the problem you are having. https://tbyb.co.uk/product_info.php/matrox-g400-32mb-p-2

I am not seeing any errors, may just be a refresh issue with browser.

to add a admin just change  file to

<head>

<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/>

</head>

<!-----------------------------------------------------put your own website in here----------------->
<div class="col-sm-<?php echo $content_width; ?> cm-pi-facebook_comments">
  <div class="fb-comments" data-href="<?php echo 'https://'. $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?>" data-width="400" data-numposts="5"></div>
 
    </div>


 

Share this post


Link to post
Share on other sites

You should be able to manage comments on your website as default. You can make many changes so just amend the code as you like in

includes/modules/content/product_info/templates/tpl_cm_facebook_comments.php

info at https://developers.facebook.com/docs/plugins/comments/#moderation-setup-instructions

This was just a quick simple addon to give a basic addon. I'm sure it can be updated to have all variables changeable in admin but that's one for a commercial developer.

For me as I only need to set this up one time its just easy to update code in one file once.

 

image.png.186b118115987b6068c7fe4b54d50213.png


 

Share this post


Link to post
Share on other sites
12 hours ago, JcMagpie said:

Try on my test website so I can see the problem you are having. https://tbyb.co.uk/product_info.php/matrox-g400-32mb-p-2

I am not seeing any errors, may just be a refresh issue with browser.

to add a admin just change  file to

<head>


<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/>

</head>

<!-----------------------------------------------------put your own website in here----------------->
<div class="col-sm-<?php echo $content_width; ?> cm-pi-facebook_comments">
  <div class="fb-comments" data-href="<?php echo 'https://'. $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?>" data-width="400" data-numposts="5"></div>
 
    </div>

@JcMagpie

I had been using: data-href="<?php echo ($PHP_SELF); ?>"

Do you know what the technical differences or benefits would be to you suggestion of: data-href="<?php echo 'https://'. $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?>"

I am just asking as an inquire... Everything you said and explained worked great when I tested it!

Thank you... Great Add-On Sir!

Share this post


Link to post
Share on other sites

As always with PHP you can skin the cat many ways.

PHP_SELF is a variable that simply returns the current script being executed. However it has been deprecated and replaced by $_SERVER['PHP_SELF']

In my humble opinion this is a more robust way of doing this. It will give a full path to the page.

$_SERVER['SERVER_NAME'] is an array containing information such as headers, paths, and script locations. It replaces $HTTP_SERVER_VARS [now removed]

so it wil give you mywebsite.com or you could replace this with $_SERVER['HTTP_HOST'] which will give www.mywebsite.com

$_SERVER['REQUEST_URI'] will hold the full request path including the querystring.

So basically tells script exactly which page to add comment to.

So with both you get mywebsite.com/some-dir/yourpage.php?q=bogus&n=10

Nothing clever all from PHP manual

http://php.net/manual/en/reserved.variables.server.php


 


 

Share this post


Link to post
Share on other sites
Posted (edited)
18 hours ago, JcMagpie said:

As always with PHP you can skin the cat many ways.

PHP_SELF is a variable that simply returns the current script being executed. However it has been deprecated and replaced by $_SERVER['PHP_SELF']

In my humble opinion this is a more robust way of doing this. It will give a full path to the page.

$_SERVER['SERVER_NAME'] is an array containing information such as headers, paths, and script locations. It replaces $HTTP_SERVER_VARS [now removed]

so it wil give you mywebsite.com or you could replace this with $_SERVER['HTTP_HOST'] which will give www.mywebsite.com

$_SERVER['REQUEST_URI'] will hold the full request path including the querystring.

So basically tells script exactly which page to add comment to.

So with both you get mywebsite.com/some-dir/yourpage.php?q=bogus&n=10

Nothing clever all from PHP manual

http://php.net/manual/en/reserved.variables.server.php


 

Awesome Explaination @JcMagpie!!!

You The Man!!!

Edited by Bobber

Share this post


Link to post
Share on other sites

Dear Zahid

I did not get a volunteer yet to test the addon. I will wait a few days and if I do not get one I will unfortunately have to create an account (something I do not want ...)

I'll notify you when I can. thanks for your constant support.

Best regards

Valqui


I'm using oscommerce Edge v2.3.4.1

Get here the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

Share this post


Link to post
Share on other sites
Posted (edited)

Hi @Bobber

Could you setup and assign an administrator for comments? ¨

I can not get the "Moderation Tool" button to appear as it appears in the image below.

Any ideas?

Best regards

Valqui

facebook.thumb.png.bb6d8597aeab63c1755cb2afd48bde1f.png

Edited by valquiria23

I'm using oscommerce Edge v2.3.4.1

Get here the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

Share this post


Link to post
Share on other sites
On 7/28/2018 at 8:37 PM, valquiria23 said:

Hi @Bobber

Could you setup and assign an administrator for comments? ¨

I can not get the "Moderation Tool" button to appear as it appears in the image below.

Any ideas?

Best regards

Valqui

facebook.thumb.png.bb6d8597aeab63c1755cb2afd48bde1f.png

Hi @valquiria23!

Yes I was able too and everything works perfectly for me...

You do need to be logged in with your facebook account and have your developer code in the module for it to work correctly...

Did you create a facebook developer account and create an app so you get the proper code to insert into this module yet?

Share this post


Link to post
Share on other sites

Hello @Bobber

I did not do any of that.

Just try with my normal facebook user number (I had to create an account). I do not create or use a developer or developer code account.

I will investigate how it is done and try again.

Thank you so much
Valqui


I'm using oscommerce Edge v2.3.4.1

Get here the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

Share this post


Link to post
Share on other sites
53 minutes ago, valquiria23 said:

Hello @Bobber

I did not do any of that.

Just try with my normal facebook user number (I had to create an account). I do not create or use a developer or developer code account.

I will investigate how it is done and try again.

Thank you so much
Valqui

This should help @valquiria23:

https://developers.facebook.com/docs/plugins/comments/

https://developers.facebook.com/docs/apps/register/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×