VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: gba on November 14, 2019, 10:52:37 AM

Title: How to check for newly registered user
Post by: gba on November 14, 2019, 10:52:37 AM
Hi!

Joomla!3.9.13
VM v3.6.8.10199

In the cart I can check for a guest user with:
if ($this->userDetails->virtuemart_user_id == 0) {}

I can check for a user logged in with:
if ($this->userDetails->virtuemart_user_id > 0) {}

But after a guest user registers, $this->userDetails->virtuemart_user_id is NULL!
Who knows why?

Kind regards,
Gerald
Title: Re: How to check for newly registered user
Post by: StefanSTS on November 14, 2019, 10:57:07 AM
We should make a forum rule that users with more than 100 posts that do not say which version they are working on should be banned immediately. ^^

;-P
Stefan
Title: Re: How to check for newly registered user
Post by: gba on November 14, 2019, 11:11:09 AM
Sorry ;)
Edited the post accordingly.
Title: Re: How to check for newly registered user
Post by: StefanSTS on November 14, 2019, 11:35:09 AM
I guess it is that way so that users can finish their shopping transaction regardless, if they activated the account via email or not.
So if there is a destinction between 0 and NULL there is a way to filter the actions that are possible.

What happens when you log out and log in again?

I haven't investigated into that, this is just what I took from the background noise following the forum and chats.

Stefan