![]() |
Friendlier: "Welcome back, [firstname]" in welcome
Hi. One of my cart testers asked if the welcome back code could display his first name only.
I think it might be a privacy issue for him, but it makes sense, too, because it's just friendlier. First name/last name is very clinical. Here's my welcome.tpl: Code:
{* $Id: welcome.tpl,v 1.23.2.1 2005/04/23 08:32:48 max Exp $ *} I think the code responsible for the name is: {$smarty.cookies.GreetingCookie|replace:"\'":"'"} However, I have no idea how to change that to first name only. It looks like fancy regex stuff at the end there. Maybe it's not. Whatever it is, though, is way over my head. :D Anybody know how to display the first name only? Thanks! |
|
Quote:
You are a better searcher than I! Thanks, that hit the spot! Thank you for that. That thread has lots of good info. Now that I did the first name mod, though, I'm seeing some artifacts from cookie handling because I have secure login chosen and a different secure domain than http domain. The name cookie gets stuffed into the https domain, and their name doesn't appear when the customer returns to the http domain on their own. (of course, this has nothing to do with the first name mod... I only noticed it now because my attention is in this area right now) This is the code welcome.tpl uses to figure out the domain to stuff the cookie into: Code:
$_tmp = parse_url($current_location); Maybe there's another thread that deals with cookies between secure and nonsecure domains? |
I'm not sure if it this is a good fix or what, but for now, I set $xcart_http_host to my domain minus the www. in config.php.
Then in welcome.tpl, I switched this: Code:
setcookie("GreetingCookie", $first_last, time()+3600*24*180, "/", $_tmp["host"]); to this: Code:
setcookie("GreetingCookie", $first_last, time()+3600*24*180, "/", $xcart_http_host); That way, whether people go to doman.com www.domain.com or subdomain.domain.com, xcart can still grab the cookie. I'm not sure if I lose anything by doing this. Obviously x-cart moved to the host method for a reason. |
All times are GMT -8. The time now is 03:00 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.