Jump to content
Sign in to follow this  
Stouffers3

Facebook Connect Support Thread

Recommended Posts

Great!!!

 

The error has disappeared :)

 

Gender in create_account.php is not showed :S name, surname, birthdate and email are showed

 

When you push on "Login with Facebook" you are redirected to create_account.php but if you need to create a account and you would to back to login.php you are redirected agagin to create_account.php, is this ok?

 

Regards!!!

Edited by PiLLaO

Share this post


Link to post
Share on other sites

FUDGE! wrong file got uploaded!

 

IN login.php

 

change:

 

tep_redirect($origin_href);

 

to:

 

echo "<script type='text/javascript'>document.location.href = '".$origin_href."';</script>";

 

In your includes/classes folder you should have the facebook.php file

In your root (store) folder you should have fbconnect.php and xd_receiver.htm

 

Those are all of the files you need.

 

This works on vanilla install.

 

There is no base_url in the new fbconnect.php file.

 

In the facebook app you put your site url (mydomain.com)

 

EDIT: The new instructions are uploaded

 

I still get the same errors...

login-fb2.php

Parse error: syntax error, unexpected '{' in /htdocs/catalog/login-fb2.php on line 26

logoff-fb2.php

Parse error: syntax error, unexpected T_NEW in /htdocs/catalog/includes/classes/facebook.php on line 4

create_account-fb2.php

Parse error: syntax error, unexpected '{' in /htdocs/catalog/create_account-fb2.php on line 26

 

I followed all the instructions, modified the database, and I still get the same responses, again it seems to be erroring out on

<?php
/*
 $Id: login.php,v 1.80 2003/06/05 23:28:24 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
//Facebook Connect
include 'includes/classes/facebook.php';
include_once "fbconnect.php";

//if user is logged in and session is valid.
if ($fbme){
       //collect some data using legacy api
   $param  =   array(
       'method'     => 'users.getinfo',
       'uids'       => $fbme['id'],
       'fields'     => 'birthday_date, locale',
       'callback'   => ''
   );

   try{
       $info           =   $facebook->api($param);
   }
   catch(Exception $o){
       error_log("Legacy Api Calling Error!");
   }
}
//end of Facebook Connect

the line with

 try{ 

is line 26...

 

 

logoff-fb2.php errors in this section, from the top...

<?php

if (!function_exists('curl_init')) {
 throw new Exception('Facebook needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
 throw new Exception('Facebook needs the JSON PHP extension.');
}

/**
* Thrown when an API call returns an exception.
*
* @author Naitik Shah <naitik@facebook.com>
*/
class FacebookApiException extends Exception
{
 /**
  * The result from the API server that represents the exception information.
  */

 

In the past I have enabled php5 using htaccess to solve problems like this but when I enable php5, it breaks the catalog overall.

 

Any thoughts or ideas?


A signature is something that reflects its user. - The dictionary

 

The question is not, 'to code, or not to code'

the question is, 'if we do not code, are we really alive?'

-- anonymous

Share this post


Link to post
Share on other sites

Great!!!

 

The error has disappeared :)

 

Gender in create_account.php is not showed :S name, surname, birthdate and email are showed

 

When you push on "Login with Facebook" you are redirected to create_account.php but if you need to create a account and you would to back to login.php you are redirected agagin to create_account.php, is this ok?

 

Regards!!!

 

hey mate...not sure if you worked this out...but i found that unless you turn in admin/configuration/customers details/gender to false you will continue to get a loop in the create account page if gender is set to true. I turned this off to start off with until i read your thread.

 

to solve it go back into login.php. I added these 2 lines of code, switched the gender back to true again via admin/config/customers details - created another account for logon for facebook and it worked.

here is the code:

 

look for in login.php

 

$customer_id = $fb_customer['customers_id'];

$customer_default_address_id = $fb_customer['customers_default_address_id'];

$customer_first_name = $fb_customer['customers_firstname'];

$customer_country_id = $fb_country['entry_country_id'];

$customer_zone_id = $fb_country['entry_zone_id'];

tep_session_register('customer_id');

tep_session_register('customer_default_address_id');

tep_session_register('customer_first_name');

tep_session_register('customer_country_id');

tep_session_register('customer_zone_id');

 

and replace with:

 

$customer_id = $fb_customer['customers_id'];

$customer_id = $fb_gender['gender_id'];

$customer_default_address_id = $fb_customer['customers_default_address_id'];

$customer_first_name = $fb_customer['customers_firstname'];

$customer_country_id = $fb_country['entry_country_id'];

$customer_zone_id = $fb_country['entry_zone_id'];

tep_session_register('customer_id');

tep_session_register('gender_id');

tep_session_register('customer_default_address_id');

tep_session_register('customer_first_name');

tep_session_register('customer_country_id');

tep_session_register('customer_zone_id');

 

you will see i have placed in the gender_id string (lines 2 and 8). I am not a php'r but this worked for me. If someone advises otherwise please add to this

 

kiwidownunder

Share this post


Link to post
Share on other sites

hi...again

 

not sure if anyone has picked this up...or maybe it is a browser setting i need to look at but have tested on 4 different browsers.

 

facebook connect works a treat by the way...thank you, i have it running on a test site

 

this is what i have discovered which could pose a problem for a single pc having multiusers who don't know each other where rogue purchases can be made.

 

logon on using facebook connect and everything is sweet. When i log out it is ok but when i want to go and re log in, and lets say i am a different user it takes me to the previous used account.

 

any suggestions would be great.

 

to test this out on the demo site here is the link:

 

http://www.freshfishdeliveries.co.nz/max/catalog/index.php

 

kiwidownunder

Edited by brentmags

Share this post


Link to post
Share on other sites

When i log out it is ok but when i want to go and re log in, and lets say i am a different user it takes me to the previous used account.

that is because you did not log off already, even when it says that suscesfull log off... you are loged in.

 

test, trying to exit from your own facebook account...

 

maybe is a cookie.

Edited by andes1

Share this post


Link to post
Share on other sites

that is because you did not log off already, even when it says that suscesfull log off... you are loged in.

 

test, trying to exit from your own facebook account...

 

maybe is a cookie.

 

hi andes1...i believe it could have something to do with the cookie :huh:

 

exited out of my own facebook account and logged off out of oscommerce, and even closed the window completely and re opened again and still i get this. Altered the cookie setting in fbconnect.php to false with dire result, i.e. can go through the fb logon process but thats about it!

even manipulated this via a few google search cookie settings

 

//Facebook Connect

include 'includes/classes/facebook.php';

include_once "fbconnect.php";

setcookie('fbs_'.$facebook->getAppId(), '', time()-100, '/', '. yourdomain.com');

 

thanks for the pointer

Share this post


Link to post
Share on other sites

hey mate...not sure if you worked this out...but i found that unless you turn in admin/configuration/customers details/gender to false you will continue to get a loop in the create account page if gender is set to true. I turned this off to start off with until i read your thread.

 

to solve it go back into login.php. I added these 2 lines of code, switched the gender back to true again via admin/config/customers details - created another account for logon for facebook and it worked.

here is the code:

 

look for in login.php

 

$customer_id = $fb_customer['customers_id'];

$customer_default_address_id = $fb_customer['customers_default_address_id'];

$customer_first_name = $fb_customer['customers_firstname'];

$customer_country_id = $fb_country['entry_country_id'];

$customer_zone_id = $fb_country['entry_zone_id'];

tep_session_register('customer_id');

tep_session_register('customer_default_address_id');

tep_session_register('customer_first_name');

tep_session_register('customer_country_id');

tep_session_register('customer_zone_id');

 

and replace with:

 

$customer_id = $fb_customer['customers_id'];

$customer_id = $fb_gender['gender_id'];

$customer_default_address_id = $fb_customer['customers_default_address_id'];

$customer_first_name = $fb_customer['customers_firstname'];

$customer_country_id = $fb_country['entry_country_id'];

$customer_zone_id = $fb_country['entry_zone_id'];

tep_session_register('customer_id');

tep_session_register('gender_id');

tep_session_register('customer_default_address_id');

tep_session_register('customer_first_name');

tep_session_register('customer_country_id');

tep_session_register('customer_zone_id');

 

you will see i have placed in the gender_id string (lines 2 and 8). I am not a php'r but this worked for me. If someone advises otherwise please add to this

 

kiwidownunder

 

Thanks for your code

 

$customer_gender = $fb_gender['gender_id'];
tep_session_register('gender_id');

 

But doesn't work for me :(

 

Still redirecting to create_account.php and gender checkbox is empty too.

 

Thanks for you time :)

 

Regards!!!

Share this post


Link to post
Share on other sites

I still get the same errors...

login-fb2.php

 

logoff-fb2.php

 

create_account-fb2.php

 

 

I followed all the instructions, modified the database, and I still get the same responses, again it seems to be erroring out on

<?php
/*
 $Id: login.php,v 1.80 2003/06/05 23:28:24 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
//Facebook Connect
include 'includes/classes/facebook.php';
include_once "fbconnect.php";

//if user is logged in and session is valid.
if ($fbme){
       //collect some data using legacy api
   $param  =   array(
       'method'     => 'users.getinfo',
       'uids'       => $fbme['id'],
       'fields'     => 'birthday_date, locale',
       'callback'   => ''
   );

   try{
       $info           =   $facebook->api($param);
   }
   catch(Exception $o){
       error_log("Legacy Api Calling Error!");
   }
}
//end of Facebook Connect

the line with

 try{ 

is line 26...

 

 

logoff-fb2.php errors in this section, from the top...

<?php

if (!function_exists('curl_init')) {
 throw new Exception('Facebook needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
 throw new Exception('Facebook needs the JSON PHP extension.');
}

/**
* Thrown when an API call returns an exception.
*
* @author Naitik Shah <naitik@facebook.com>
*/
class FacebookApiException extends Exception
{
 /**
  * The result from the API server that represents the exception information.
  */

 

In the past I have enabled php5 using htaccess to solve problems like this but when I enable php5, it breaks the catalog overall.

 

Any thoughts or ideas?

 

 

got the same problem here :( please help :)

Share this post


Link to post
Share on other sites

Thanks for your code

 

$customer_gender = $fb_gender['gender_id'];
tep_session_register('gender_id');

But doesn't work for me :(

 

Still redirecting to create_account.php and gender checkbox is empty too.

 

Thanks for you time :)

 

Regards!!!

 

Sorry, this is the code thay I used

 

$customer_gender = $fb_gender['gender_id'];
tep_session_register('customer_gender');

 

Regards!!

Share this post


Link to post
Share on other sites

I saw the following error on Facebook Developers site... http://forum.developers.facebook.net/viewtopic.php?pid=168567

 

I too am suffering from the same issue. I've tried everything I know, but no luck here either. What host provider are you with?

Aaaaa shit, my server is running with php4 :( damn. maybe there is a way around... let's hope at least :)

Share this post


Link to post
Share on other sites

So it mine, however when I add the following..

 

AddType x-mapp-php5 .php .php4

 

I get this

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory

 

From there I go to enabled register_globals as suggested by a number of websites.. I try this

 

php_value register_globals 1

in the .htaccess file also... it then claims I have to many redirects and does a error 500

 

This webpage has a redirect loop.

 

The webpage at http://www.rainbowcomputers.ca/catalog/e500.php has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

 

Here are some suggestions:

Reload this web page later.

Learn more about this problem.

More information on this error

Below is the original error message

 

Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

 

Can anyone lend any suggestions to me?


A signature is something that reflects its user. - The dictionary

 

The question is not, 'to code, or not to code'

the question is, 'if we do not code, are we really alive?'

-- anonymous

Share this post


Link to post
Share on other sites

Thanks for your code

 

$customer_gender = $fb_gender['gender_id'];
tep_session_register('gender_id');

 

But doesn't work for me :(

 

Still redirecting to create_account.php and gender checkbox is empty too.

 

Thanks for you time :)

 

Regards!!!

 

hi dude...interesting for that bit of code above doesn't always get a desired result. So i had a look at the code itself and have tested it...and had others test it and create an account and it is working well.

 

on a fresh or NEW install (cos i want to use fb connect and am running PHP Version 5.2.5) the only notable change was in the create_account.php.

i stepped through the find and replace, uploaded and created accounts to find subtle differences and this works for me.

 

follow what it informs to the end on the instructions then come back to - d(FIND): the code below is the old code which i copied and pasted over the newly inserted code if this makes sense :'(

 

<?php

if (ACCOUNT_GENDER == 'true') {

?>

<tr>

<td class="main"><?php echo ENTRY_GENDER; ?></td>

<td class="main"><?php echo tep_draw_radio_field('gender', 'm') . '  ' . MALE . '  ' . tep_draw_radio_field('gender', 'f') . '  ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>

</tr>

<?php

 

gender hopefully for you should now work in the create account :thumbsup:

Share this post


Link to post
Share on other sites

Hello:

 

I'm new with OSCommerce, this Facebook feature sounds great but after follow instructions from version 1.1 when I tried to login using Facebook account, it works until I enter my Facebook account... then in the page create_account.php simply appears:

 

1054 - Unknown column 'fb_user_id' in 'where clause'

 

select count(*) as total from customers where fb_user_id = '506549406'

 

[TEP STOP]

 

I deleted all white spaces from my files as you suggest but it is still the problem.

 

Besides this, I'd like to share with you smth curious happened to me when I tried to register OSCOMMERCE FORUM using my FB account... IT ALSO DIDN'T WORK!?!?!

I made a normal login but after this it appears:

 

We could not locate a linked forum account

Complete log in with new account (BUTTON)

 

After press this button it appears:

 

An Error Occurred

Sorry, an error occurred. If you are unsure on how to use a feature, or don't know why you got this error message, try looking through the help files for more information.

[#1005] An error occurred while attempting to authorize this Facebook Connect action

 

After tried a couple of times... Finally I had to register entering in the FORUM all my info.

Thanks in advance for helping me with my error message...

 

Percy

Edited by Percevals

Share this post


Link to post
Share on other sites

Hello:

 

I'm new with OSCommerce, this Facebook feature sounds great but after follow instructions from version 1.1 when I tried to login using Facebook account, it works until I enter my Facebook account... then in the page create_account.php simply appears:

 

1054 - Unknown column 'fb_user_id' in 'where clause'

 

select count(*) as total from customers where fb_user_id = '506549406'

 

[TEP STOP]

 

I deleted all white spaces from my files as you suggest but it is still the problem.

 

Besides this, I'd like to share with you smth curious happened to me when I tried to register OSCOMMERCE FORUM using my FB account... IT ALSO DIDN'T WORK!?!?!

I made a normal login but after this it appears:

 

We could not locate a linked forum account

Complete log in with new account (BUTTON)

 

After press this button it appears:

 

An Error Occurred

Sorry, an error occurred. If you are unsure on how to use a feature, or don't know why you got this error message, try looking through the help files for more information.

[#1005] An error occurred while attempting to authorize this Facebook Connect action

 

After tried a couple of times... Finally I had to register entering in the FORUM all my info.

Thanks in advance for helping me with my error message...

 

Percy

 

Hello, you have to install the sql file in your database.

 

 

hi dude...interesting for that bit of code above doesn't always get a desired result. So i had a look at the code itself and have tested it...and had others test it and create an account and it is working well.

 

on a fresh or NEW install (cos i want to use fb connect and am running PHP Version 5.2.5) the only notable change was in the create_account.php.

i stepped through the find and replace, uploaded and created accounts to find subtle differences and this works for me.

 

follow what it informs to the end on the instructions then come back to - d(FIND): the code below is the old code which i copied and pasted over the newly inserted code if this makes sense :'(

 

<?php

if (ACCOUNT_GENDER == 'true') {

?>

<tr>

<td class="main"><?php echo ENTRY_GENDER; ?></td>

<td class="main"><?php echo tep_draw_radio_field('gender', 'm') . '  ' . MALE . '  ' . tep_draw_radio_field('gender', 'f') . '  ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>

</tr>

<?php

 

gender hopefully for you should now work in the create account :thumbsup:

 

Hi!!!

 

Thanks for you time :)

 

Using this code gender are still empty when you use create account with facebook connect, I have to be missing something.

 

Regards!!!

Share this post


Link to post
Share on other sites

Hi guys I put this contribution to my code but when I tried to login with fb login button I get this

API Error Code: 100

API Error Description: Invalid parameter

Error Message: next is not owned by the application.

Can someone tell me what caused it and how to fix it?

Share this post


Link to post
Share on other sites

Hy...

I've installed this contribution and i'm wondering if someone can help me with the code (without the customer seeing it) for logging out from my site and also from facebook.

Thnks in advance...

Share this post


Link to post
Share on other sites

Hi, I wanted to know if you can explain the forth step in the instructions, I just can figure out how to Run the database.sql file, in fact, I don't know what to do at that step. The rest of the instruction are pretty much straight forward.

 

Well thanks for the help!

Edited by Pilloli

Share this post


Link to post
Share on other sites

well looks like dont work very well for me, when i goto login.php and click into the connect with facebook, my browser is redirected to createaccount section of my site :S

 

someone know why that happend?

Share this post


Link to post
Share on other sites

I tried everything but when I click on the FB button nothing happens, and I still can't figure out the database step...

Edited by Pilloli

Share this post


Link to post
Share on other sites

Am I missing something? I have used facebook apps before, and with logins there needs to be modifications made to the DB... I see in the instructions a SQL query mentioned but I don't see the file included in the zip file. what gives?

Share this post


Link to post
Share on other sites

Am I missing something? I have used facebook apps before, and with logins there needs to be modifications made to the DB... I see in the instructions a SQL query mentioned but I don't see the file included in the zip file. what gives?

ALTER TABLE customers

ADD fb_user_id VARCHAR(32);

Share this post


Link to post
Share on other sites

Hi,

A few questions here. Does this work well with the PWA (purchase without account) mods and I'm assuming it won't interfere with any payment modules such as Paypal IPN or Authorize.net, right?

 

If I understand how this works, a customer can use their Facebook login details to speed up the checkout process? Is this all it does?

 

Thanks for the help!

 

Steve

Share this post


Link to post
Share on other sites
Does this work well with the PWA (purchase without account) mods

 

I DONT KNOW

 

it won't interfere with any payment modules such as Paypal IPN or Authorize.net, right

 

right

 

a customer can use their Facebook login details to speed up the checkout process

 

YES

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
Sign in to follow this  

×