AutoLogin

  • Posts: 78
  • Thank you received: 4
  • Hikamarket Multivendor Hikashop Business
11 years 1 week ago #132158

Hi,

I am using hikashop for registering new users.
When the user registers, they are not automatically logged in.

However, when the user registers during the checkout process, they are automatically logged in and it proceeds to the next step.
How can i change this, that they are also automatically logged in with normal hiksahop registration not during checkout process.


Thanks and br

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 week ago #132217

Hi,

Hikashop is based on the Joomla registration system, but we are adding some more fields.
So it's not a HikaShop related problem, you can try with the Joomla registration, it don't auto log after the registration process ;)

Please Log in or Create an account to join the conversation.

  • Posts: 78
  • Thank you received: 4
  • Hikamarket Multivendor Hikashop Business
11 years 1 week ago #132219

I know that Joomla does not auto login.
But hikashhop does, when registering during the checkout process.

I would like to have the same code executed for "normal" registering like it is when registering during checkout.
Where should i add the code for this ? In after_register file from hikashop ?
It should not interfere with hikashop.
So hikashop registration should be fully finished (incl. adding address and custom fields etc.)
I tried wit an autologin plugin, but then the adress and custom fields were not added.
Can you tell me, where I should add code, so that it will notinterfere with hikashop.
I would like to add something like:

function autoLogin($user,$isnew){
$app = JFactory::getApplication();
if($app->isSite() && $isnew)
{
# Login process
$credentials = array(
"username" => $user["username"],
"password" => $user["password_clear"]
);
}
$app->login($credentials);
}

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
11 years 1 week ago #132417

That code is not valid. You were right that you need to add custom code in the file "after_register" via the menu Display>views, but it's not the correct code.

You should have instead something like that:

<?php
$app = JFactory::getApplication();
$credentials = array('username'=>$_REQUEST['data']['register']['username'],'password'=>$_REQUEST['data']['register']['password']);
$app->login($credentials);
?>

Please Log in or Create an account to join the conversation.

  • Posts: 78
  • Thank you received: 4
  • Hikamarket Multivendor Hikashop Business
11 years 1 week ago #132441

Hi,

The code is working well.
However, it is not possible to redirect the user in after_register file.
If redirecting is used, the address and custom fields will not be stored.

Anyway, thanks a lot for your help !

Thanks and br
Rene

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum