- Posts: 82
- Thank you received: 5
AutoLogin
12 years 10 months ago #132158
by tgdkere2
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
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.
12 years 10 months ago #132217
by Xavier
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
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.
12 years 10 months ago #132219
by tgdkere2
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
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.
12 years 10 months ago #132417
by nicolas
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:
You should have instead something like that:
Code:
<?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.
12 years 10 months ago #132441
by tgdkere2
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
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.182 seconds