Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Welcome Username In Header Rate Topic   - - - - -

 
  • Markman1
  • Member
  • Members
  • Join Date: 08-Jun 13
  • 35 posts

Posted 08 January 2014 - 05:36 PM #1

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.c...r-cs-cart.html 



 
  • meetshamee
  • Advanced Member
  • Trial users
  • Join Date: 12-Feb 13
  • 92 posts

Posted 08 January 2014 - 05:47 PM #2

Nice Idea ! Like this


Posted Image

 

Posted 08 January 2014 - 07:14 PM #3

Example of what you are looking to do:

http://cscart4.requincreative.com/

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 08 January 2014 - 07:49 PM #4

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.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • Markman1
  • Member
  • Members
  • Join Date: 08-Jun 13
  • 35 posts

Posted 08 January 2014 - 08:18 PM #5

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

 

Posted 08 January 2014 - 09:09 PM #6

*
POPULAR

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}. (<a href="{"auth.logout?redirect_url=`$return_current_url`"|fn_url}" rel="nofollow" class="account">{__("sign_out")}</a>)
{/if}
{else}
Welcome, Guest. (<a href="{"auth.login_form"|fn_url}">{__("sign_in")}</a>)
{/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.

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • jimmyod
  • Senior Member
  • Members
  • Join Date: 24-Apr 12
  • 449 posts

Posted 08 January 2014 - 09:41 PM #7

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}. (<a href="{"auth.logout?redirect_url=`$return_current_url`"|fn_url}" rel="nofollow" class="account">{__("sign_out")}</a>)
{/if}
{else}
Welcome, Guest. (<a href="{"auth.login_form"|fn_url}">{__("sign_in")}</a>)
{/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.

Nice one.
Thanks. :grin:

 

Posted 08 January 2014 - 11:03 PM #8

You're welcome

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • Markman1
  • Member
  • Members
  • Join Date: 08-Jun 13
  • 35 posts

Posted 09 January 2014 - 06:18 PM #9

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

Attached Files



 

Posted 09 January 2014 - 07:11 PM #10

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


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

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • panto
  • Member
  • Members
  • Join Date: 14-Aug 11
  • 30 posts

Posted 09 January 2014 - 09:27 PM #11

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}. (<a href="{"auth.logout?redirect_url=`$return_current_url`"|fn_url}" rel="nofollow" class="account">{__("sign_out")}</a>)
{/if}
{else}
Welcome, Guest. (<a href="{"auth.login_form"|fn_url}">{__("sign_in")}</a>)
{/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.


works fine for me, Thanks requincreative.
www.singular.com.cy
www.xpcpro.com

 
  • Markman1
  • Member
  • Members
  • Join Date: 08-Jun 13
  • 35 posts

Posted 10 January 2014 - 12:22 AM #12

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

Mark

 

Posted 10 January 2014 - 02:32 AM #13

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

Mark

You're welcome

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • dtjan01
  • Advanced Member
  • Members
  • Join Date: 04-Dec 13
  • 68 posts

Posted 10 January 2014 - 03:36 AM #14

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

 

Posted 10 January 2014 - 01:11 PM #15

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"}
    <i class="icon-user"></i><a href="{"profiles.update"|fn_url}">{$title}</a><i class="icon-down-micro"></i>
{/capture}

And replace to this:
{capture name="title"}
    {if $auth.user_id}
	    <i class="icon-user"></i><a href="{"profiles.update"|fn_url}">
		    {$user_data.firstname} {$user_data.lastname}</a><i class="icon-down-micro"></i>
    {else}
	    <i class="icon-user"></i><a href="{"profiles.update"|fn_url}">{__("guest")}</a><i class="icon-down-micro"></i>
    {/if}
{/capture}

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

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



 
  • dtjan01
  • Advanced Member
  • Members
  • Join Date: 04-Dec 13
  • 68 posts

Posted 10 January 2014 - 01:46 PM #16

its working now, thanks

 

Posted 12 January 2014 - 07:14 PM #17

You are welcome.

its working now, thanks



 
  • meetshamee
  • Advanced Member
  • Trial users
  • Join Date: 12-Feb 13
  • 92 posts

Posted 18 January 2014 - 04:44 AM #18

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"}
	<i class="icon-user"></i><a href="{"profiles.update"|fn_url}">{$title}</a><i class="icon-down-micro"></i>
{/capture}

And replace to this:
{capture name="title"}
	{if $auth.user_id}
		<i class="icon-user"></i><a href="{"profiles.update"|fn_url}">
			{$user_data.firstname} {$user_data.lastname}</a><i class="icon-down-micro"></i>
	{else}
		<i class="icon-user"></i><a href="{"profiles.update"|fn_url}">{__("guest")}</a><i class="icon-down-micro"></i>
	{/if}
{/capture}

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



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

 
  • tom437
  • Senior Member
  • Members
  • Join Date: 10-Jul 10
  • 635 posts

Posted 20 January 2014 - 01:13 PM #19

Hello,

Will this work on the v3.0.4?

Thanks
3.0.4
Hosting for less.
www.step2stephosting.com

 

Posted 20 January 2014 - 01:16 PM #20

I think, yes.

Hello,

Will this work on the v3.0.4?

Thanks