VirtueMart Forum

VirtueMart 2 + 3 => General Questions => Topic started by: AnthonyWang on August 07, 2018, 11:01:25 am

Title: Disable user automatically logged after registration without clicking activation
Post by: AnthonyWang on August 07, 2018, 11:01:25 am
How disable user always logged after click register and checkout button then registration ?
i want only click activation link email's user can check,but after search the solution many days,still got nothing,
Quote
https://forum.virtuemart.net/index.php?topic=132040.0
Code: [Select]
if ($user->get('id')) {
$this->setRedirect('index.php');
return true;
}
the code only in J2.5 not J3

even i tried VM Framework Loader during Plugin Updates plugin set to no,in tab2


using Joomla 3.8.11 and VM 3.2.15


Title: Re: Disable user automatically logged after registration without clicking activation
Post by: GJC Web Design on August 07, 2018, 17:52:07 pm
do u mean the user can still chk out even though activation set?

I just coded this for another client but with core hack and always when registering

You need to change in the components\com_virtuemart\controllers\user.php

function saveData($cartObj)

destroy the session and cart is what i did

without a hack u could try a system plugin or in the user model there are plugins called in the public function store(&$data) function

Title: Re: Disable user automatically logged after registration without clicking activation
Post by: Studio 42 on August 07, 2018, 22:40:10 pm
You can overirde the controller using a system plugin as explained and change the registration function to force user activation before continue checkout process.
You should use onAfterInitialise or onAfterRoute and check if you are in front-end and in virtuemart (and perhaps view and task) to not loead all the virtuemart helpers in other components.
Title: Re: Disable user automatically logged after registration without clicking activation
Post by: AnthonyWang on August 18, 2018, 11:10:35 am
Thank you, GJC and Studio 42