Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Facebook Connect Support Thread


Guest

Recommended Posts

Hello long time....some people are getting troubles loggin off from the store.

 

First remember this:

 

logoff.php - first change yourdomain.com to your websites domain. Make sure you have the '.' before it.

 

FIND:

 

$cart->reset();

 

ADD AFTER:

 

//Facebook Connect

include 'includes/classes/facebook.php';

include_once "fbconnect.php";

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

 

Second if the customer wants to logoff completely, he has to do it, from FB and from your store.

find the first </table></td>

 

add before that

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

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

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_FB; ?></td> <?php //FACEBOOK LOGOFF LITERATURE AND BUTTON ?>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><a target="_blank" href="http://m.facebook.com/logout.php" onclick="FB.Connect.logout(function() { reload(); }); return false;" ><img id="fb_logout_image" src="http://static.ak.fbcdn.net/images/fbconnect/logout-buttons/logout_small.gif" alt="Connect"/></a> </td>

</tr>

 

 

EASY!

Edited by andes1
Link to comment
Share on other sites

  • 4 weeks later...

 

I only find with IE8 I have to refresh the login page to show FB login correctly as it will only show "Login with Facebook" with no link or image - could need some help on this please!

 

 

I have this problem too.... does anyone have an answer to it???

Link to comment
Share on other sites

I have this problem too.... does anyone have an answer to it???

 

This worked for me....

 

Just add these two xmlns attributes to your page’s main html tag:

 

xmlns:fb="http://www.facebook.com/2008/fbml"

 

xmlns:og="http://opengraphprotocol.org/schema/"

 

After adding this attribute to the HTML tag your, html tag – fully completed should look like this:

 

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">

 

 

I hope this helps.

Link to comment
Share on other sites

This worked for me....

 

Just add these two xmlns attributes to your page’s main html tag:

 

xmlns:fb="http://www.facebook.com/2008/fbml"

 

xmlns:og="http://opengraphprotocol.org/schema/"'>http://opengraphprotocol.org/schema/"

 

After adding this attribute to the HTML tag your, html tag – fully completed should look like this:

 

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/"'>http://opengraphprotocol.org/schema/">

 

 

I hope this helps.

More specific!

It just prints out xmlns:fb="http://www.facebook.com/2008/fbml"

 

xmlns:og="http://opengraphprotocol.org/schema/"'>http://opengraphprotocol.org/schema/"

 

So I added <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/ "> to the header content of the login.php page

Seems to work fine now

Getting the Phoenix off the ground

Link to comment
Share on other sites

  • 3 weeks later...

i've just installed facebook connect on my local testing site and got an Javascript error. I went through the code and found that

FB.init({appId: '<?=$fbconfig['appid' ]?>', status: true, cookie: true, xfbml: true});

if I change <?=$fbconfig['appid' ]?> from above code to <?php $fbconfig['appid' ]?> the javascript error would disappear but facebook login is still not working for me. Please help.

Link to comment
Share on other sites

I tried this contribution on a clean install of Osc 2.2rc2a and have trouble getting it to work.

The login.php and create_account.php refreshes itself and never actually got logged in or do anything. This happens when I'm logged in to my facebook account and when I logged out the page would stop refreshing itself.

I am currently running this on my local machine, and in logoff.php I have changed the domain name to ".localhost" like below

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

 

I see other people have mentioned the same problem, has anyone actually got this sorted? I've spend 2 days working at it and still can't find any fix. Any help would be appreciated.

Thank you in advance.

Link to comment
Share on other sites

  • 3 weeks later...

Hi Guys,

 

I sorta have this working but not without it's issues. Not sure if it is browser version, firefox, or conflict with PWA or what, but....

 

I also have the create_account.php refreshing itself and never actually got logged in or do anything - keeps saying password has to be 6 characters! Even when you make sure it is, it just comes back to that! Frustrating. And when I have the facebook connect active it gives the same error for a simple create account! If I remove FB Connect, everything works fine.

 

BUT - for me, I have managed to make a facebook account (before I started getting this error) and it keeps working sweet for me. This error seems to have come about in the last month!

 

Can anyone help? I would love to get this going as I think lots of people like to log in this way now.

 

Thanks

Link to comment
Share on other sites

Hey Everyone!

 

I don't have these codes in my files::

 

<tr>
                       <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                       <td align="right"><?php echo tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN); ?></td>
                       <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                     </tr>

 

<tr>
       <td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

 


 

I'm going to try adding the code that I'm supposed to add before/after anyway, just to see what happens. Looking forward to an answer! :) Thanks!

Link to comment
Share on other sites

HI,

 

I FB login button requests for permision everytime the buton is clicked.

How do i make it to request permision only when the user clicks the FB login buton for the first time and from then onwards, it should log them in straight away.

Thanks

Aarthi

Link to comment
Share on other sites

  • 3 weeks later...

Hello.

 

My site uses STS...

 

I have installed the addon , but when I log in through facebook the site login button does not change to logout.

 

Meaning the customer_id session was not registered.

 

Does anyone knows if for the STS users some additional changes should be made ?

 

Thanks

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hello

 

I have a problem with character encoding. I want to use FB connect here in Hungary, but if I connect, the neme has encoding problems.

Example: My name is Dárió, but after FB connect it's showing DĂĄriĂł. Hungarian special characters is in utf8.

What I need to do to get a correct values (or show it correct) from facebook?

 

Sorry for my bad english-

 

Thank you

Link to comment
Share on other sites

a solution for logout problem:

 

in create_account.php

 

find

<tr>
   <td>
		  <div id="fb-root"></div>
    <script type="text/javascript">
	    window.fbAsyncInit = function() {
		    FB.init({appId: '<?=$fbconfig['appid' ]?>', status: true, cookie: true, xfbml: true});
		    /* All the events registered */
		    FB.Event.subscribe('auth.login', function(response) {
			    // do something with response
			    login();
		    });
		    FB.Event.subscribe('auth.logout', function(response) {
			    // do something with response
			    logout();
		    });
	    };
	    (function() {
		    var e = document.createElement('script');
		    e.type = 'text/javascript';
		    e.src = document.location.protocol +
			    '//connect.facebook.net/en_US/all.js';
		    e.async = true;
		    document.getElementById('fb-root').appendChild(e);
	    }());
	    function login(){
		    document.location.href = "create_account.php";
	    }
	    function logout(){
		    document.location.href = "logoff.php";
	    }
</script>
<?php if($fbme){
}else{?>
   <p>
    <fb:login-button autologoutlink="true" perms="email,offline_access,user_birthday,user_location,user_work_history,user_religion_politics,user_relationships">Connect with Facebook</fb:login-button>
   </p>
   <?php }?>
 </td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

 

replace with

 

<tr>
   <td>
<div id="fb-root"></div>
    <script type="text/javascript">
	    window.fbAsyncInit = function() {
		    FB.init({appId: '<?php echo $fbconfig['appid' ];?>', status: true, cookie: true, xfbml: true});
		    /* All the events registered */
		    FB.Event.subscribe('auth.login', function(response) {
			    // do something with response
			    login();
		    });
		    FB.Event.subscribe('auth.logout', function(response) {
			    // do something with response
			    logout();
		    });
	    };
	    (function() {
		    var e = document.createElement('script');
		    e.type = 'text/javascript';
		    e.src = document.location.protocol +
			    '//connect.facebook.net/en_US/all.js';
		    e.async = true;
		    document.getElementById('fb-root').appendChild(e);
	    }());
	    function login(){
		    document.location.href = "create_account.php";
	    }
	    function logout(){
		    document.location.href = "logoff.php";
	    }
</script>
<?php if($fbme){?>
<div align="right">
<a href="#" onclick="FB.logout(function() {window.location = 'Login.php'; }); return false;" class="main" ><img id="fb_logout_image" src="http://static.ak.fbcdn.net/images/fbconnect/logout-buttons/logout_small.gif" alt="Connect"/> Use another Facebook account?</a></div>
<?php }else{?>
   <p>
    <fb:login-button autologoutlink="true" perms="email,offline_access,user_birthday,user_location,user_work_history,user_religion_politics,user_relationships">Connection</fb:login-button>
   </p>
   <?php }?>
    </td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

 

in logoff.php

 

add this code somewhere in the <body>

<div id="fb-root"></div>
    <script type="text/javascript">
	    window.fbAsyncInit = function() {
		    FB.init({appId: '<?php echo $fbconfig['appid' ];?>', status: true, cookie: true, xfbml: true});
	    };
	    (function() {
		    var e = document.createElement('script');
		    e.type = 'text/javascript';
		    e.src = document.location.protocol +
			    '//connect.facebook.net/en_US/all.js';
		    e.async = true;
		    document.getElementById('fb-root').appendChild(e);
	    }());
</script>
<div align="right">
<a href="#" onclick="FB.logout(function() {window.location = 'index.php'; }); return false;" class="main" ><img id="fb_logout_image" src="http://static.ak.fbcdn.net/images/fbconnect/logout-buttons/logout_small.gif" alt="Connect"/> Don't forget to disconnect from Facebook!</a></div>

 

thumbsup.gif

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I need help for two problems.

 

1. How can I setup fb connect to display the correct birthdate in create_account.php? My store is setup to show/input the birthdate in dd/mm/yyyy format but when try to create a new account via facebook connect the birthdate is autocompleted like mm/dd/yyyy.

 

2. Does anyoane succeded to put the facebook login button in loginbox.php column?

It doesn't look great to have fb login only in login.php and create_account.php and not in column left, if you use loginbox.php, of course.

 

Thank you in advance,

Cristi

Link to comment
Share on other sites

It it possible to ad more then one shop to the facebook account to recieve the API key, I tried today and it seems only possible with one shop for one account

 

If you have 5 shops you need to register 5 FB accounts, really stupid

Link to comment
Share on other sites

  • 4 weeks later...
(B) FIND:

 

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td align="right"><?php echo tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

 

 

These lines dont exist in oscommerce 2.3.1 version of login.php ?? There are major changes I think, that require a reword of the files.

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

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I got the version 2.2 RC2. Facebook Connect have been working for me for a long period of time. For a week ago it stoped working, withour changing the code. Did anyone else experience this?

 

This happens; When I haven't logged into Facebook, nothing happens when I click the buttom. When I am logged into Facebook, I am comming to the logout.php page when I click the login buttom :(

 

Anyone have a clue what's wrong?

 

Cheers

Andreas

Link to comment
Share on other sites

Hi again

Facebook has recently updated its API and make it compulsory for Facebook Connect applications to use the latest OAuth 2.0. The announcement was made last Tuesday, 13th December 2011 in the official. It is after that date this integration doesnt work.

 

Some older keys were not configured to support OAuth2.0 upgrades, so I resetted tha Facebook app to have a new 15 character key (the new standard) I also changed this in the database. Since the api key and app ID now is the same, maybe there must be some more changes than just update them in the fbconnect.php file?

 

Does anyone get connect to work with OSCommerce 2.2 RC2?

 

//Andreas

Link to comment
Share on other sites

Here is some info of the changes, I did not fix it myself yet, anyone else get it?:)

 

http://developers.fa.../blog/post/614/

https://developers.f.../blog/post/525/

 

Btw. Now when I did a resetting, nothing happens when I click the fb.button. The same problem for me now with 2.2 RC2 as you before with OScommerce version 2.3.1

Edited by addeaz
Link to comment
Share on other sites

Here is some info of the changes, I did not fix it myself yet, anyone else get it?smile.png

 

http://developers.fa.../blog/post/614/

https://developers.f.../blog/post/525/

 

Btw. Now when I did a resetting, nothing happens when I click the fb.button. The same problem for me now with 2.2 RC2 as you before with OScommerce version 2.3.1

hi andreas, this contribution would be made ​​obsolete by changes in facebook for those who use oscommerce ... should wait for a correction so that we can reuse.

I do not know much about php, maybe you can find some other contribution to work in joomla, or any other and adapt to our needs in oscommerce, any news or if someone could make corrections post to the forum, thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...