hi,
i think the problem is that virtuemart uses the current user object and doesnt create a new one
//To find out, if we have to register a new user, we take a look on the id of the usermodel object.
//The constructor sets automatically the right id.
$new = ($this->_id < 1);
if(empty($this->_id)){
//$user = JFactory::getUser();
$user = new JUser;
} else {
$user = JFactory::getUser($this->_id);
}
this fixed the problem for me
This is the best solutions proposed and actually it is working. However there is a small "bug" in the flow. If the user tries to checkout without first having logged in then:
a) he fills his registration data
b) selects the button "Register & Checkout"
c) check in the backend and found that his account IS NOT activated
d) he checks out succesfully (without loggin in)
e) the email sent to him includes a working link ... BUT the message he gets is "Registration failed: Verification code not found."
i assume that in step (e) the link is working because when i clicked on it, it Activated user's account!!