Welcome Username In Header

Is there a way to add then display "Welcome Joe Jones" in the header?

Ideally, I'd like to display the welcome message and also add a sign out button. I do not want to use the My Account drop down.

Can anyone suggest a solution for this for me?

Thanks

Mark

P.S. [edit from imac]: There is a free add-on to do this: http://marketplace.cs-cart.com/add-ons/customer-experience/welcome-message-for-cs-cart.html

Nice Idea ! Like this





Example of what you are looking to do:



[url=“http://cscart4.requincreative.com/”]http://cscart4.requincreative.com/[/url]

I recently read an article where online shoppers were questioned on this and many did not like the idea, as it gives the consumer the impression that they are being spied upon. However, Amazon in itself disproves this theory.



Very simple to do, however, but depends on your CS-Cart version.

Yes, Jeremy, that is what I am trying to do, if Welcome Guest would change to Welcome Mark or something after log in. If that is the way that works, how can I do that?



(4.02 MultiVendor)



Thanks Jeremy



Mark

Sure.



In your Admin area navigate to Design → Template Editor and then Templates → Blocks → Static Templates



Click “Create New” button and name it something memorable. I named mine “welcome_user.tpl” and then “Create”



Double Click on “welcome_user.tpl” and paste the following code:



{if $auth.user_id}
{if $user_info.firstname || $user_info.lastname}
Welcome, {$user_info.firstname} {$user_info.lastname}. ()
{/if}
{else}
Welcome, Guest. ({__("sign_in")})
{/if}




[size=4]Then Save changes.[/size]



[size=4]Then go to Design → Layouts and click on the location and grid that you want to add it. I added it to the default location.[/size]



[size=4]Click “Add Block” and choose tab for “Create new block” then choose the “Template” block. Name it whatever you want and then select “_welcome_user” from the Template dropdown. Then click the “Create” button.[/size]



[size=4]You may have to clear your cache.[/size]

[quote name=‘requincreative’ timestamp=‘1389215378’ post=‘174750’]

Sure.



In your Admin area navigate to Design → Template Editor and then Templates → Blocks → Static Templates



Click “Create New” button and name it something memorable. I named mine “welcome_user.tpl” and then “Create”



Double Click on “welcome_user.tpl” and paste the following code:


<br />
{if $auth.user_id}<br />
{if $user_info.firstname || $user_info.lastname}<br />
Welcome, {$user_info.firstname} {$user_info.lastname}. (<a href="{"auth.logout?redirect_url=`$return_current_url`"|fn_url}" rel="nofollow" class="account">{__("sign_out")}</a>)<br />
{/if}<br />
{else}<br />
Welcome, Guest. (<a href="{"auth.login_form"|fn_url}">{__("sign_in")}</a>)<br />
{/if}
```<br />
<br />
Then Save changes.<br />
<br />
Then go to Design -> Layouts and click on the location and grid that you want to add it.  I added it to the default location.<br />
<br />
Click "Add Block" and choose tab for "Create new block" then choose the "Template" block.  Name it whatever you want and then select "_welcome_user" from the Template dropdown.  Then click the "Create" button.<br />
<br />
You may have to clear your cache.<br />
[/quote]Nice one.<br />
Thanks. <img src="upload://iKNGSw3qcRIEmXySa8gItY6Gczg.gif" class="bbc_emoticon" alt=":grin:">

You're welcome

Jeremy,



I created template, saved, cleared cache, went to layouts, went to Add New Block, selected template, gave it a name, but then my newly created template was not in the drop down to select from. (see image)



What did I do wrong and how can I fix?



Thanks Jeremy



Mark

welcomeuser.png

[quote name='Markman1' timestamp='1389291532' post='174822']

Jeremy,



I created template, saved, cleared cache, went to layouts, went to Add New Block, selected template, gave it a name, but then my newly created template was not in the drop down to select from. (see image)



What did I do wrong and how can I fix?



Thanks Jeremy



Mark

[/quote]



[color=#282828][font=arial, verdana, tahoma, sans-serif][size=3]In your Admin area navigate to Design → Template Editor and then Templates → Blocks → Static Templates[/size][/font][/color]

[quote name='requincreative' timestamp='1389215378' post='174750']

Sure.



In your Admin area navigate to Design → Template Editor and then Templates → Blocks → Static Templates



Click “Create New” button and name it something memorable. I named mine “welcome_user.tpl” and then “Create”



Double Click on “welcome_user.tpl” and paste the following code:



{if $auth.user_id}
{if $user_info.firstname || $user_info.lastname}
Welcome, {$user_info.firstname} {$user_info.lastname}. ()
{/if}
{else}
Welcome, Guest. ({__("sign_in")})
{/if}




Then Save changes.



Then go to Design → Layouts and click on the location and grid that you want to add it. I added it to the default location.



Click “Add Block” and choose tab for “Create new block” then choose the “Template” block. Name it whatever you want and then select “_welcome_user” from the Template dropdown. Then click the “Create” button.



You may have to clear your cache.

[/quote]



works fine for me, Thanks requincreative.

Jeremy, I missed the Static part. Got it now and it works fine. Thanks for the help.



Mark

[quote name='Markman1' timestamp='1389313345' post='174843']

Jeremy, I missed the Static part. Got it now and it works fine. Thanks for the help.



Mark

[/quote]

You're welcome

is there anyway to change the “my account” to guest when it is not log in and change to full name after log in?

Dear dtjan01,



Sure, it is possible, and not so difficult.



Go to your actual frontend skin's folder and edit the /blocks/my_account.tpl file. (in the 4.x versions the template file location is:

design/themes/YOUR_THEME_NAME/templates/blocks/my_account.tpl)



Search for this code (in the beggining of the file):


{capture name="title"}
{$title}
{/capture}




And replace to this:


{capture name="title"}
{if $auth.user_id}

{$user_data.firstname} {$user_data.lastname}

{else}
{__("guest")}
{/if}
{/capture}




Then clear you cache (incl. the template cache) and it is done.


[quote name='dtjan01' timestamp='1389324967' post='174847']

is there anyway to change the “my account” to guest when it is not log in and change to full name after log in?

[/quote]

its working now, thanks

You are welcome.


[quote name='dtjan01' timestamp='1389361595' post='174869']

its working now, thanks

[/quote]

[quote name='drahos.istvan' timestamp='1389359486' post='174867']

Dear dtjan01,



Sure, it is possible, and not so difficult.



Go to your actual frontend skin's folder and edit the /blocks/my_account.tpl file. (in the 4.x versions the template file location is:

design/themes/YOUR_THEME_NAME/templates/blocks/my_account.tpl)



Search for this code (in the beggining of the file):


{capture name="title"}
{$title}
{/capture}




And replace to this:


{capture name="title"}
{if $auth.user_id}

{$user_data.firstname} {$user_data.lastname}

{else}
{__("guest")}
{/if}
{/capture}




Then clear you cache (incl. the template cache) and it is done.

[/quote]





its working ver 4 , but how is on version 3 ?

Hello,



Will this work on the v3.0.4?



Thanks

I think, yes.


[quote name='tom437' timestamp='1390223595' post='175542']

Hello,



Will this work on the v3.0.4?



Thanks

[/quote]