Jump to content

[FREE Modules] Register / Login to Prestashop with Facebook Connect


Recommended Posts

Alhamdulillah, akhirnya jadi juga nih module...
Tapi sayangnya pas module ini jadi Prestashop 1.3.7 dah final, padahal module ini dibuat pake versi 1.3.6.

Mohon bantuan rekan2 untuk uji coba module ini ya... (saya gk tanggung jawab kalau langsung diinstall di situs yang sudah berjalan)

Blum ada dokumentasi instalasinya, penjelasan singkat sbb:
1. Sebelum install module harus buat FacebookApplication dulu di sini
2. Kita akan pakai AppID dan AppSecret, trus jangan lupa di settingan URL Situs aplikasi di set ke urls Prestashop.
3. Backup dulu situs prestashopnya (PENTING)
4. Download modulenya (lihat attachment)
5. a. Folder 'classes' dikopi ke folder 'classes', overwrite file Customer.php (lebih baik buat backupny)
5. b. Copy folder 'idfbcon' ke dalam fhttp://www.fileserve.com/file/7vJFVmJolder 'modules'
5. c. Copy file 'authentication.php' ke folder root, terakhir copy file 'authentication.tpl' ke 'themes/prestashop/' (dalam kasus ini saya pake theme bawaan, untuk theme yang lain silakan sesuaikan sendiri ya....)
6. Install module dari backoffice, set konfigurasi module (perlu Facebook APP ID dan Facebook Secret dari aplikasi FB yang sudah dibuat di langkah 1).

Kekurangan yang diketahui:
1. jika login menggunakan account yang belum connect dengan facebook, maka tombol facebook ikutan jadi logout (pegennya sih register/login with facebook)
2. banyak lagi kekurangan lain yang perlu dicari (Bantuan rekan2 sangat diperlukan)
===========================================================================
Update versi 0.2
1. one click installation (lewati langkah 5 diatas) = belum saya test

Lihat Demo di sini
Download Guide di sini

IDFBCon_v.0.1.zip

IDFBCon_v.0.2.zip

  • Like 1
Link to comment
Share on other sites

Alhamdulillah, akhirnya jadi juga nih module...
Tapi sayangnya pas module ini jadi Prestashop 1.3.7 dah final, padahal module ini dibuat pake versi 1.3.6.

Mohon bantuan rekan2 untuk uji coba module ini ya... (saya gk tanggung jawab kalau langsung diinstall di situs yang sudah berjalan)

Blum ada dokumentasi instalasinya, penjelasan singkat sbb:
1. Sebelum install module harus buat Applikasi Facebook dulu di sini
2. Kita akan pakai APP ID dan APP Secret, trus jangan lupa di settingan URL Situs aplikasi di set ke urls Prestashop.
3. Backup dulu situs prestashopnya (PENTING)
4. Download modulenya IDFBCon_v.0.1.zip
5. a. Folder 'classes' dikopi ke folder 'classes', overwrite file Customer.php (lebih baik buat backupny)
5. b. Copy folder 'idfbcon' ke dalam fhttp://www.fileserve.com/file/7vJFVmJolder 'modules'
5. c. Copy file 'authentication.php' ke folder root, terakhir copy file 'authentication.tpl' ke 'themes/prestashop/' (dalam kasus ini saya pake theme bawaan, untuk theme yang lain silakan sesuaikan sendiri ya....)
6. Install module dari backoffice, set konfigurasi module (perlu Facebook APP ID dan Facebook Secret dari aplikasi FB yang sudah dibuat di langkah 1).

Kekurangan yang diketahui:
1. jika login menggunakan account yang belum connect dengan facebook, maka tombol facebook ikutan jadi logout (pegennya sih register/login with facebook)
2. banyak lagi kekurangan lain yang perlu dicari (Bantuan rekan2 sangat diperlukan)

Demo disini
cuman minta subdomain dari temen.


Can you translate step to install this module ?
Link to comment
Share on other sites

@Gamelane
no problem in my test site

@dric83
Thanks for sharing here

@Tropical Dream
v1.4 isn't recommended for production use yet. Probably won't work, cause v1.4 will be different with v1.3,
the promising feature is the capability of overriding Prestashop core. I hope I have the time to port this module to v1.4 when its already released.

Link to comment
Share on other sites

  • 2 weeks later...
I tried to install the module, but I get several errors in my version 1.3;
I run a weird sort of script that makes it difficult to climb to the top of my site (very rare).

I do not see the button by any party to the template I use (www.eluniversodelperro.com) even if it appears in the default template.


Find a solution for 1.3.1 ?
Link to comment
Share on other sites

I so far have not found any solution, because besides the ones who created the issue is not answered.

The button works on the original theme, but not in others and does not work for registration

I am very interested in this module, if anyone has it working properly to send me a message


Give me 2 days !
I will be back with this module in 1.3.1 !
Ok ?
Regards,
Nadine
Link to comment
Share on other sites

Thank you for this great module and sharing. For me it is working on test site but I cant make it work on my site. When I chose to register it point me to regular registration page. My website is suvenircic.com/prestashop . Will it work if it is not in domain root and how to fix it. I use Version 1.3.2.3. Thanks.

Link to comment
Share on other sites

Salema laykum, baraka ALLAHO FIKA AKHI

Alhamdulillah, akhirnya jadi juga nih module...
Tapi sayangnya pas module ini jadi Prestashop 1.3.7 dah final, padahal module ini dibuat pake versi 1.3.6.

Mohon bantuan rekan2 untuk uji coba module ini ya... (saya gk tanggung jawab kalau langsung diinstall di situs yang sudah berjalan)

Blum ada dokumentasi instalasinya, penjelasan singkat sbb:
1. Sebelum install module harus buat FacebookApplication dulu di sini
2. Kita akan pakai AppID dan AppSecret, trus jangan lupa di settingan URL Situs aplikasi di set ke urls Prestashop.
3. Backup dulu situs prestashopnya (PENTING)
4. Download modulenya (lihat attachment)
5. a. Folder 'classes' dikopi ke folder 'classes', overwrite file Customer.php (lebih baik buat backupny)
5. b. Copy folder 'idfbcon' ke dalam fhttp://www.fileserve.com/file/7vJFVmJolder 'modules'
5. c. Copy file 'authentication.php' ke folder root, terakhir copy file 'authentication.tpl' ke 'themes/prestashop/' (dalam kasus ini saya pake theme bawaan, untuk theme yang lain silakan sesuaikan sendiri ya....)
6. Install module dari backoffice, set konfigurasi module (perlu Facebook APP ID dan Facebook Secret dari aplikasi FB yang sudah dibuat di langkah 1).

Kekurangan yang diketahui:
1. jika login menggunakan account yang belum connect dengan facebook, maka tombol facebook ikutan jadi logout (pegennya sih register/login with facebook)
2. banyak lagi kekurangan lain yang perlu dicari (Bantuan rekan2 sangat diperlukan)
===========================================================================
Update versi 0.2
1. one click installation (lewati langkah 5 diatas) = belum saya test

Lihat Demo di sini
Download Guide di sini
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 3 weeks later...
I so far have not found any solution, because besides the ones who created the issue is not answered.

The button works on the original theme, but not in others and does not work for registration

I am very interested in this module, if anyone has it working properly to send me a message


Give me 2 days !
I will be back with this module in 1.3.1 !
Ok ?
Regards,
Nadine


Hi @botmez,
Do you have solution for 1.3.1 yet? After installing both 0.1 and 0.2 I got a blank page on admin panel "modules". Look forward to your solution! Thanks in advance.
Link to comment
Share on other sites

  • 2 months later...

I get this error and disappears

 

Not Found

 

The requested URL /store/mi-cuenta was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Link to comment
Share on other sites

  • 2 weeks later...

Careful guys , dont install , it fuked up my shop . Had to go through the code to know what have been changed.

If you install it and end up with your shop not working just restore the file Customer.php in /class and authentication.php in /

  • Like 2
Link to comment
Share on other sites

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

Hi,

PS I have 1.2.4 and PWA module.

I want to write a login module for facebook for PS version 1.2.4

Unfortunately, after logging into Facebook I get redirected to the shop:

 

http://MY_SITE/authe...on.php?code=AQB[...]W#_=_

 

and I have: Hack attempt.

 

What is wrong?

How to correct file authentication.php for PS 1.2.4?

this part:

/* FB Connect */
//--------------------------------
if (Tools::getValue('fb'))
{
$create_account = 1;
$smarty->assign('email_create', 1);
$smarty->assign('fb_connect',1);
$smarty->assign('appid', Configuration::get('FB_APPID'));
}
if (Tools::getValue('registered')) {
 //echo '<p>signed_request contents:</p>';
 $response = FBTools::parse_signed_request($_REQUEST['signed_request'],Configuration::get('FB_SECRET'));

 $reg_metadata_fields = '[
  {"name":"name"},
  {"name":"first_name"},
  {"name":"last_name"},
  {"name":"email"},
  {"name":"password"},
  {"name":"birthday"},
  {"name":"gender"},
  {"name":"captcha"}]';
 //echo '<pre>';
 //print_r($response);
 //echo '</pre>';
 if (strcmp($reg_metadata_fields,$response['registration_metadata']['fields']) != 0)
  $errors[] = Tools::displayError('registration metadata fields not valid');
 if (Customer::customerExists($response['registration']['email'])){
  //$errors[] = Tools::displayError('someone has already registered with this e-mail address (this module need further development)');
//$smarty->assign('email_create', 1);
//$smarty->assign('existing_user', 1);
//$smarty->assign('appid', Configuration::get('FB_APPID'));

$customer = new Customer();
$authentication = $customer->getByEmail($response['registration']['email']);

$customer->fb_uid = $response['user_id'];
$customer->active = 1;
$customer->deleted = 0;
//$_POST['lastname'] = $response['registration']['last_name'];
//$_POST['firstname'] = $response['registration']['first_name'];
//$_POST['passwd'] = $response['registration']['password'];
//$_POST['email'] = $response['registration']['email'];
//$errors = $customer->validateControler();
$cookie->id_customer = intval($customer->id);
$cookie->customer_lastname = $customer->lastname;
$cookie->customer_firstname = $customer->firstname;
$cookie->logged = 1;
$cookie->passwd = $customer->passwd;
$cookie->email = $customer->email;
if (Configuration::get('PS_CART_FOLLOWING') AND (empty($cookie->id_cart) OR Cart::getNbProducts($cookie->id_cart) == 0))
 $cookie->id_cart = intval(Cart::lastNoneOrderedCart(intval($customer->id)));
Module::hookExec('authentication');
if ($back = Tools::getValue('back'))
 Tools::redirect($back);
Tools::redirect('my-account.php');
$existing_user = 1;
 }

 if (!sizeof($errors))
 {
  $customer = new Customer();
  $customer_birthday = explode('/',$response['registration']['birthday']);
  $customer->birthday = intval($customer_birthday[2]).'-'.intval($customer_birthday[0]).'-'.intval($customer_birthday[1]);
  if ($response['registration']['last_name'] == "male")
   $_POST['id_gender'] = 1;
  else if ($response['registration']['last_name'] == "female")
   $_POST['id_gender'] = 2;
  else
   $_POST['id_gender'] = 9;
  $_POST['lastname'] = $response['registration']['last_name'];
  $_POST['firstname'] = $response['registration']['first_name'];
  $_POST['passwd'] = $response['registration']['password'];
  $_POST['email'] = $response['registration']['email'];
  $errors = $customer->validateControler();
  $customer->fb_uid = $response['user_id'];
if (!sizeof($errors))
{
 $customer->active = 1;
 if (!$customer->add())
  $errors[] = Tools::displayError('an error occurred while creating your account');
 else
 {
  if (!Mail::Send(intval($cookie->id_lang), 'account', 'Welcome!',
  array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => $response['registration']['password']), $customer->email, $customer->firstname.' '.$customer->lastname))
   $errors[] = Tools::displayError('cannot send email');
  $smarty->assign('confirmation', 1);
  $cookie->id_customer = intval($customer->id);
  $cookie->customer_lastname = $customer->lastname;
  $cookie->customer_firstname = $customer->firstname;
  $cookie->passwd = $customer->passwd;
  $cookie->logged = 1;
  $cookie->email = $customer->email;
  Module::hookExec('createAccount', array(
   '_POST' => $_POST,
   'newCustomer' => $customer
  ));
  //$fbcookie = FBTools::get_facebook_cookie((Configuration::get('FB_APPID')), (Configuration::get('FB_SECRET'))); 
  if ($back)
   Tools::redirect($back);
  Tools::redirect('my-account.php');

 }
}
 }
}
if (Tools::getValue('fblogin') OR Tools::getValue('code'))
{
$app_id = (Configuration::get('FB_APPID'));
$app_secret = (Configuration::get('FB_SECRET'));
$my_url = "http://".$_SERVER['HTTP_HOST']."/authentication.php";

$code = $_REQUEST["code"];

if(empty($code)) {
$dialog_url = "http://www.facebook.com/dialog/oauth?client_id="
 . $app_id . "&redirect_uri=" . urlencode($my_url);

echo("<script> top.location.href='" . $dialog_url . "'</script>");
}

$token_url = "https://graph.facebook.com/oauth/access_token?client_id="
. $app_id . "&redirect_uri=" . urlencode($my_url) . "&client_secret="
. $app_secret . "&code=" . $code;
$access_token = file_get_contents($token_url);

$graph_url = "https://graph.facebook.com/me?" . $access_token;

$user = json_decode(file_get_contents($graph_url));
$customer = new Customer();
$authentication = $customer->getByEmail($user->email);
//print_r($user);
/* Handle brute force attacks */

sleep(1);
if ($user->id != $customer->fb_uid)
 $errors[] = Tools::displayError('fb login authentication failed');
else
{
 $cookie->id_customer = intval($customer->id);
 $cookie->customer_lastname = $customer->lastname;
 $cookie->customer_firstname = $customer->firstname;
 $cookie->logged = 1;
 $cookie->passwd = $customer->passwd;
 $cookie->email = $customer->email;
 if (Configuration::get('PS_CART_FOLLOWING') AND (empty($cookie->id_cart) OR Cart::getNbProducts($cookie->id_cart) == 0))
  $cookie->id_cart = intval(Cart::lastNoneOrderedCart(intval($customer->id)));
 Module::hookExec('authentication');
 if ($back = Tools::getValue('back'))
  Tools::redirect($back);
 Tools::redirect('my-account.php');
}

}
//--------------------------------

for_PS1.2.4_with_PWA.zip

Link to comment
Share on other sites

  • 1 month later...

Hi everyone,

Just to say that I install this module (v0.2) my prestashop version : 1.3.7 (I've update my 1.3.1 to 1.3.7 very easily)

 

The module work great unless for one thing, just a line that prevent the fb_uid to be stored in the database during registering.

The wrong line causes 1. fb login authentication failed

 

So :

in the file Customer.php, line 125 :

$this->fb_uid = 0;

replace by

if(empty($this->fb_uid)) $this->fb_uid = 0;

Because most of the time fb_uid contain the user's fb_uid! off course!!

 

If you're already install the module the file is in the folder classes/Customer.php

If you're not install the module the file is in the module folder idfbcon/Customer.php

 

Hope it'll help

 

(attached the same archive that the first post WITH the new line)

IDFBCon_v.0.2.zip

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

@Gamelane

no problem in my test site

 

@dric83

Thanks for sharing here

 

@Tropical Dream

v1.4 isn't recommended for production use yet. Probably won't work, cause v1.4 will be different with v1.3,

the promising feature is the capability of overriding Prestashop core. I hope I have the time to port this module to v1.4 when its already released.

 

dinantikan kalau sudah bisa untuk v1.4.7. kalau boleh dinotifikasi ke [email protected] ya... thx. GBU.

Link to comment
Share on other sites

  • 2 weeks later...

i tried login to your demo site 1st time its ok, after logout and try login again and again i got this error:

 

There is 1 error :

1. fb login authentication failed

Hola, donde conseguiste el modulo? me lo puedes pasar? gracias

Link to comment
Share on other sites

  • 2 months later...

Hello i installed this module in presta 1.4 but i have a big problem It's not possible to registered and connecting to my shop and in backoffice i dont see basket and customer !

Help me please

 

I delete this modul but the probleme dont delete

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...

Careful guys , dont install , it fuked up my shop . Had to go through the code to know what have been changed.

If you install it and end up with your shop not working just restore the file Customer.php in /class and authentication.php in /

You saved my day! Thank you!

  • Like 3
Link to comment
Share on other sites

  • 5 weeks later...

▃ ▄ ▅ ▆ 100%

─▀██▀───▀██▀─▀██──██─▀██▀▀ ▀─

──██─────██───██▄█▀───██▄█───

──██─────██───██▀█▄───██▀█───

─▄██▄▄█─▄██▄─▄██──██─▄██▄▄ ▄

 

 

 

 

batako - kerajinan

Link to comment
Share on other sites

  • 3 weeks later...

Hi everyone,

Just to say that I install this module (v0.2) my prestashop version : 1.3.7 (I've update my 1.3.1 to 1.3.7 very easily)

 

The module work great unless for one thing, just a line that prevent the fb_uid to be stored in the database during registering.

The wrong line causes 1. fb login authentication failed

 

So :

in the file Customer.php, line 125 :

$this->fb_uid = 0;

replace by

if(empty($this->fb_uid)) $this->fb_uid = 0;

Because most of the time fb_uid contain the user's fb_uid! off course!!

 

If you're already install the module the file is in the folder classes/Customer.php

If you're not install the module the file is in the module folder idfbcon/Customer.php

 

Hope it'll help

 

(attached the same archive that the first post WITH the new line)

IDFBCon_v.0.2.zip

 

 

 

 

Is possible to see the Module working on your page?

 

Thank you. i am using presta 1.3.7

Link to comment
Share on other sites

  • 1 month later...

Hey can you help me please, I restore original these 2 files , problem still exists.

 

Personally I did this and it worked:

Unistall and then delete the module via ftp. Delete the relative raw of the modules table in the database (via PHP My admin). Replace the two files. Clear smarty.

 

Keep in mind that this was in the 1.4 prestas version.

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

After installing this module, I am getting following error

"

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/home/themes/theme171/authentication.tpl" on line 2 "{include file=$tpl_dir./breadcrumb.tpl}" - Unexpected "/", expected one of: "{" , "$" , "identifier" , INTEGER' in /var/www/home/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:431 Stack trace: #0 /var/www/home/tools/smarty/sysplugins/smarty_internal_templateparser.php(2855): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /var/www/home/tools/smarty/sysplugins/smarty_internal_templateparser.php(2920): Smarty_Internal_Templateparser->yy_syntax_error(37, '/') #2 /var/www/home/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(51): Smarty_Internal_Templateparser->doParse(37, '/') #3 /var/www/home/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(82): Smarty_Internal_SmartyTemplateCompiler->doCompile('{capture name=p...') #4 /var/www/home/tools/smarty/sysplugins/smarty_internal_template.php(261): Smarty in /var/www/home/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 431

"

my prestashop version is 1.4

 

really getting on my nerves.. Need Help!!!!!!!! :-(

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

Hi,

 

There is a way to Override or just to pass the FB authentication to Presta, to work with authcontroller:

 

If one of you want to play with the ideas, it might solve all of the problem and it could work on the new version of Presta

 

For the registration form you can write a module which contains two hook handler functions. These will be:

public function hookCreateAccountForm() {}

public function hookCreateAccount($params) {}

The first function allows you to add additional fields to the registration form (by default these are inserted at the end of the form authentication.tpl, although you could move them all as a single group elsewhere). It should simply return the additional form html you require.

The second function provides you with two parameters to handle the account creation process. This is executed after the standard fields have been validated and the new customer has been created. Unfortunately you cannot do validation on your additional fields using this (you would need to either use javascript or override AuthController to perform your own authentication in the preProcess()member function). In one of my own custom modules for a site I have the following, for example:

public function hookCreateAccount($params)

{

$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');

$customer = $params['newCustomer'];

$address = new Address(Address::getFirstCustomerAddressId((int)$customer->id));

$membership_number = $params['_POST']['membership_number'];

....

....

}

$params['newCustomer'] is a standard Prestashop element in the array and contains the newly created customer object. Your fields will be in the $params['_POST'] array - in my case it was an input field called membership_number.

I just finished working of PRESTA Facebook FANPAGE module. I uploaded the module to one of my latest thread, feel free to use it. ( Working for 1.5.x version - with easy instruction )

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 5 weeks later...
  • 4 weeks later...

hello everyone.. how can i get that facebook login modules for my new prestashop i just want to make login section for my client's ps for shop online throught login via facebook from my client's ps website...

 

 

Thanks & Regards

Link to comment
Share on other sites

i need to install free versions modules not paid versions... do you have any option ...?

 

@ladiesland I been working on a free one, I should have it posted by the end of this coming week. I was looking for one too for long time. We need one for PS, hopefully It will became a core module included with PS.

 

I am doing some test/code-cleanup this week when I get some time.

 

If any one can help with coding PM me. I'll have it on https://github.com/Ha99y/ Soon

Link to comment
Share on other sites

×
×
  • Create New...