Author Topic: Disable user automatically logged after registration without clicking activation  (Read 250 times)

AnthonyWang

  • Beginner
  • *
  • Posts: 47
  • VirtueMart Version: 3.2.1
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


Currently using :
Joomla 3.6.5 / Virtuemart 3.2.1 / PHP 5.5.9-1ubuntu4.17

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8221
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
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

GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3402
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
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.

AnthonyWang

  • Beginner
  • *
  • Posts: 47
  • VirtueMart Version: 3.2.1
Thank you, GJC and Studio 42
Currently using :
Joomla 3.6.5 / Virtuemart 3.2.1 / PHP 5.5.9-1ubuntu4.17