![]() |
Hello, Customer. (If you're not Customer, click here.)
I remember seeing a mod on the forums here that made it to where you could greet the customer in the welcome.tpl file like:
Hello, Customer. (If you're not Customer, click here.) And then if they click "here" it clears the greet cookie and makes it say: "Hello, sign in to get your latest news. New Customer? Start Here." Does anyone have this? |
anyone figure this one out?
|
Look at your store while logged in, and view the html code for the button that says log out.
Adapt that log out code and put it in your welcome text. |
yeah, i was in a hurry and hoped that someone else had already done this to save me some time...
Here's what I did for this...maybe there's a better way, but this was quick for me.... I added a label variable called lbl_welcome_notme and set it equal to: (if this if not you, please click here) Of course, you could hard-code this as well. Then, I edited welcome.tpl ( skin1/customer/main/welcome.tpl ) and changed the line: <h3>{$lng.lbl_welcome_back}, {$smarty.cookies.GreetingCookie|replace:"\'":"'"} </h3> with <h3>{$lng.lbl_welcome_back}, {$smarty.cookies.GreetingCookie|replace:"\'":"'"} {$lng.lbl_welcome_notme} </h3> Next, I edited include/login.php and added: if($REQUEST_METHOD=="GET") { if($mode=="ungreet") { if(!empty($active_modules["Greet_Visitor"])) include "../modules/Greet_Visitor/unset_cookie.php"; } } Last, I went to modules/Greet_Visitor/ dir and copied set_cookie.php to unset_cookie.php and changed the setcookie line to read: setcookie("GreetingCookie", "", -1, "/", $_tmp["host"]); to clear the cookie. I'm sure there's probably a cleaner way to do it..but this is how I did it...If anyone sees a reason not to do it this way, let me know. <ramble> Possible issue in general with this mod is if you re-direct to https on log-in to the store....when the customer logs out, the cookie is set the https hostname...which is often different (e.g. secure.domain.com instead of www.domain.com).... If you log-out while accessing via https and then come back to the store via http, the cookie won't be there for that hostname (www.domain.com) anyway.... To fix this, you'd just need to manipulate "$_tmp[host]" -- you could strip off the first part of the domain so that you're left with .domain.com and that would make the cookie good for the whole domain. </ramble> Thanks, Dave |
interesting reply... but could you dumb this down for me please, step by step? for example, i dont understand where you set the variables you mention. also, does this work with version 4?
rich |
All times are GMT -8. The time now is 03:32 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.