XF 2.2 Extending Registration Complete

Hello,

I am extending registration complete class, Other code is working fine when registration completes. but when I try to get User ID of user registered it is returning 0 as user id instead of original user ID.

This is my code sample.

PHP:
class RegistrationComplete extends XFCP_RegistrationComplete
{
    public function actionIndex()
    {

        $visitor = \XF::visitor();

        
        $visitor_id = $visitor->user_id

    }

}


Please help me getting user id when registration completes.
Thanks.
 
Assuming you're extending XF\Service\User\RegistrationComplete, I think you should be able to use $this->user->user_id.
 
Last edited:
Back
Top Bottom