Hi,
I am desperately trying to get the user`s e-mail address within details.tpl.
For some reason, the obvious approach did not work out as expected.
First I tried Lazy Loading within the template:
[{ if $oxcmp_user }]
oxusername: [{ $oxcmp_user->oxuser__oxusername->value }]
[{ /if }]
I never get any value, even if the user is definitely logged in.
[{debug}] tells me, that oxcmp_user = true. This Boolean value is all I can find in the debug list.
Then I tried it via a “getter” function
So I modified view.php (of course calling it from details.tpl):
public function getUserMail()
{
$oUser = $this->getUser();
// also tried alternatively: $oUser = oxNew( 'oxuser' );
if ($oUser)
{
error_log("** 1 ". $oUser->oxuser__oxusername->value);
return $oUser->oxuser__oxusername->value;
} else {
error_log("** 2 : ". $oUser->oxuser__oxusername->value);
return;
}
}
error_log shows for both variants getUser und oxNew) that the oUser object is not set.
Am I missing something here?
I`d appreciate any useful comment!
Thanks
floko