X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   $userinfo on welcome.tpl (https://forum.x-cart.com/showthread.php?t=50773)

jherzog 11-16-2009 01:13 PM

$userinfo on welcome.tpl
 
I need to display a message on the customer/main/welcome.tpl page. I need to access a couple of user specific fields typically in the $userinfo.additional_fields array. But $userinfo is not defined in home.php and hence is empty in welcome.php.

I can add to home.php
$smarty->assign("currentUser",func_userinfo($login,'C')) ;

And it works great.

But:
1) I only need this for welcome.php but it will load this info for all pages driven by home.php (I could write more php to get around this).
2) I have to modify the core file home.php to do this. I would rather only modify the template files.

Can I do this completely in welcome.tpl?

I tried:
{php}
$userinfo = func_userinfo($login,'C');
{/php}

But that didn't work. Any suggestions ?

Thanks,
Jed

Jon 11-17-2009 10:04 AM

Re: $userinfo on welcome.tpl
 
I wouldn't suggest doing this in template files but you could try:

Code:

{php}
$userinfo = func_userinfo($login,'C');
echo 'Welcome ' . $userinfo['first_name'];
{/php}


In home.php

FIND:

# Assign the current location line

BEFORE ADD:

Code:

if (empty($cat))
$smarty->assign("currentUser",func_userinfo($login,'C'))  ;



All times are GMT -8. The time now is 04:16 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.