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

Hello, Customer. (If you're not Customer, click here.)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-23-2004, 07:36 AM
 
salsabeel salsabeel is offline
 

Senior Member
  
Join Date: Jan 2004
Posts: 132
 

Default 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?
Reply With Quote
  #2  
Old 08-17-2004, 02:38 PM
 
anigmad anigmad is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default

anyone figure this one out?
Reply With Quote
  #3  
Old 08-17-2004, 03:26 PM
  Jon's Avatar 
Jon Jon is offline
 

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

Default

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.
Reply With Quote
  #4  
Old 08-17-2004, 04:58 PM
 
anigmad anigmad is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default

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
Reply With Quote
  #5  
Old 08-31-2004, 01:41 PM
 
AnimeJeff AnimeJeff is offline
 

Advanced Member
  
Join Date: Jun 2004
Posts: 30
 

Default

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
__________________
X-cart x-cart-4.0.0pro
MySQL 3.23.58
Linux 2.4.22-1.2188.nptl Fedora Core 1
Apache 2.0.48
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 03:52 PM.

   

 
X-Cart forums © 2001-2020