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

How do I show Customer's name instead of login??

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-18-2004, 05:10 AM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default How do I show Customer's name instead of login??

I want to have the Customer's first name followed by the first letter of their last name to show up instead of their login ID.

I tried replacing {$login} in authbox.tpl with {$customer_info.firstname} {$customer_info.lastname|truncate:1:".":true}, but nothing shows up.

Anyone know how to do this? While I was testing Xcart earlier on I noticed that my name would show up right after "Welcome," at the top of the main customer area, but I don't want to simply pull the name from a cookie as the coe for that feature uses...unless, of course, the customer is logged in.

Is the logged in Customer's name always the same as that found in the cookie that is checked in welcome.tpl?

Thanks!
Reply With Quote
  #2  
Old 01-18-2004, 06:47 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

try {$userinfo.firstname}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 01-18-2004, 08:02 AM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

Thanks shan! Worked like a charm.

Had to change {$userinfo.lastname|truncate:1:".":true} to {$userinfo.lastname|truncate:2:".":true}.

Why is it that I needed to truncate to 2 characters instead of only one to show the lastname + "."?

Also, is there a place I can find a list of all of Xcart's variable names, where they are declared, and at least a short description of what they do? This would make modding sooo much easier.
Reply With Quote
  #4  
Old 01-18-2004, 10:35 AM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

Well, if worked at first...now it only works half the time.

For some reason the variable $userinfo shows up empty in every area but the shopping cart.

Any idea how to change this? For now I am just using an If, Then statement to select from the $login and $userinfo, but this defeats the purpose of what I had in mind to begin with.
Reply With Quote
  #5  
Old 01-20-2004, 06:16 PM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

Well, it seems that $customer_info.firstname works when viewing products, and only then. And it seems that $userinfo.firstname only works when viewing the shopping cart. However, $login works all the time but it only shows the login name.

Looks like I will have to do some PHP coding to get this one to work.

Any other ideas before go ahead with that?
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #6  
Old 01-18-2005, 03:47 PM
  Jon's Avatar 
Jon Jon is offline
 

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

Default

Kinda old but I'm reviewing your posts for optimizations so I thought I'd drop a note in here.

You can open auth.php and at the bottom put:

Code:
if ($login) { $name = func_query_first("SELECT firstname,lastname from $sql_tbl[customers] WHERE login='$login'"); $smarty->assign("name",$name); }

Then use {$name.firstname} and {$name.lastname}
Reply With Quote
  #7  
Old 01-18-2005, 05:42 PM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

Actually, I solved this one ages ago. Just didn't think to post it....in fact, I can't even remember how I did it, that was so long ago. About two days off from a year ago.

Thanks for the tip though! Hope you find the optimizations useful.
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #8  
Old 01-30-2005, 11:42 AM
  eaglemobiles's Avatar 
eaglemobiles eaglemobiles is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 167
 

Default Please any one explain abit more

What actually shall I do to change user name to show first and last name when customer login.

Thanks
__________________
X-Cart Gold 4.3.2
X-Cart Gold 4.4.1
Unix

High Quality CCTV DVRs & Cameras
http://www.eaglemobiles.co.uk/CCTV
Reply With Quote
  #9  
Old 01-30-2005, 12:08 PM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default Re: Please any one explain abit more

Quote:
Originally Posted by eaglemobiles
What actually shall I do to change user name to show first and last name when customer login.

What Jon posted above looks like it would work pretty well.
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #10  
Old 01-30-2005, 12:22 PM
  eaglemobiles's Avatar 
eaglemobiles eaglemobiles is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 167
 

Default Hi

Then use {$name.firstname} and {$name.lastname}

where shall use this code, Thanks for help
__________________
X-Cart Gold 4.3.2
X-Cart Gold 4.4.1
Unix

High Quality CCTV DVRs & Cameras
http://www.eaglemobiles.co.uk/CCTV
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 01:05 PM.

   

 
X-Cart forums © 2001-2020