Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

$userinfo on welcome.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-16-2009, 01:13 PM
 
jherzog jherzog is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 93
 

Default $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
__________________
Jed Herzog
Gold X-Cart 4.0.17
http://www.outliersolutions.com
Portland Advertising Agency,
Portland Web Design
Reply With Quote
  #2  
Old 11-17-2009, 10:04 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default 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')) ;
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020