[HOW TO] - Welcome Message / Customer Name in Header
51 posts
• Page 2 of 3 • 1, 2, 3
Re: [HOW TO] - Welcome Message / Customer Name in Header
Hey great add-on Fido-x
Let me ask you is it possible to add to this a not you? button?
Example
Welcome, customer Not you?(->this would go to login page)
Thanks, great contrib
Let me ask you is it possible to add to this a not you? button?
Example
Welcome, customer Not you?(->this would go to login page)
Thanks, great contrib
- jmrchaves
- Posts: 3
- Joined: Sun Dec 20, 2009 1:20 pm
Re: [HOW TO] - Welcome Message / Customer Name in Header
jmrchaves wrote:Hey great add-on Fido-x
Let me ask you is it possible to add to this a not you? button?
Example
Welcome, customer Not you?(->this would go to login page)
Thanks, great contrib
This is a good suggestion, but shouldn't it log them out, if they click on "Not you?"?
- Yakiv
- Posts: 207
- Joined: Tue Dec 15, 2009 9:31 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
Great job!!!
Tks
Tks

- viniciusdepaula
- Posts: 2
- Joined: Tue Dec 29, 2009 5:42 pm
Re: [HOW TO] - Welcome Message / Customer Name in Header
Beautiful! Thanks!
- nocko
- Posts: 24
- Joined: Tue Jan 26, 2010 6:14 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
GREAT JOB!! THANK YOU SO MUCH!! 

-

Cristina - Posts: 21
- Joined: Thu Feb 04, 2010 8:41 pm
- Location: Zandvoort, The Netherlands
Re: [HOW TO] - Welcome Message / Customer Name in Header
In my real-world job, I do a lot of consulting to large companies, and their marketing principles seem to revolve around the following concepts:
(1) gather as much useful information about the customer as possible
(2) have logical use for that information in your product selection & promotions
Whilst having the ability to greet someone correctly is great (infact in Germany it can be insulting not to use someone's title as it's a a sign of respect for their qualifications etc.), I feel that having the ability to know that a product is better suited to a woman rather than a man is great for promotional purposes.
That said, it means that you need to extend your product metadata to include these new fields too (in order to make use of this new real-time sales smarts), and possibly change way too many php files to be able to upgrade or take advantage of other people's mods.
IMHO, if you just want salutation, then I agree the effort isn't worth the risk of a mistake happening (even if it's caused by the customer), plus not everyone wants to divulge their sex as part of registration.
But, if you're thinking of collecting it as part of additional marketing fields to be used for analytics and sales promotions, then you've got a pretty difficult journey of mods ahead of you. My thoughts are with you.
- [MB]
(1) gather as much useful information about the customer as possible
(2) have logical use for that information in your product selection & promotions
Whilst having the ability to greet someone correctly is great (infact in Germany it can be insulting not to use someone's title as it's a a sign of respect for their qualifications etc.), I feel that having the ability to know that a product is better suited to a woman rather than a man is great for promotional purposes.
That said, it means that you need to extend your product metadata to include these new fields too (in order to make use of this new real-time sales smarts), and possibly change way too many php files to be able to upgrade or take advantage of other people's mods.
IMHO, if you just want salutation, then I agree the effort isn't worth the risk of a mistake happening (even if it's caused by the customer), plus not everyone wants to divulge their sex as part of registration.
But, if you're thinking of collecting it as part of additional marketing fields to be used for analytics and sales promotions, then you've got a pretty difficult journey of mods ahead of you. My thoughts are with you.
- [MB]
- melbagnato
- Posts: 10
- Joined: Wed Jan 13, 2010 5:39 am
- Location: Melbourne
Re: [HOW TO] - Welcome Message / Customer Name in Header
Will this work in 1.4.0?
-

The Alchemist - Posts: 300
- Joined: Sun Nov 22, 2009 3:04 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
The Alchemist wrote:Will this work in 1.4.0?
Good question... this is full of useless contributions since version is getting changed every week.
- luiseduardo
- Posts: 52
- Joined: Sat Mar 06, 2010 10:09 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
Plus 1 they should have a contribs section with sub sections for versions.
-

The Alchemist - Posts: 300
- Joined: Sun Nov 22, 2009 3:04 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
Hi fido-x,
Can it be used on 1.4.7?
Vivian
Can it be used on 1.4.7?
Vivian
- Vivian
- Posts: 24
- Joined: Tue May 18, 2010 1:36 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
Hi,
I am running 1.4.7 and it gives me the following error when I try to run.
Fatal error: Call to a member function https() on a non-object in /content/HostingPlus/v/m/vmaxx.ie/web/catalog/controller/common/header.php on line 60
Can anyone explain what's wrong?
Vivian
I am running 1.4.7 and it gives me the following error when I try to run.
Fatal error: Call to a member function https() on a non-object in /content/HostingPlus/v/m/vmaxx.ie/web/catalog/controller/common/header.php on line 60
Can anyone explain what's wrong?
Vivian
- Vivian
- Posts: 24
- Joined: Tue May 18, 2010 1:36 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
Vivian wrote:Hi,
I am running 1.4.7 and it gives me the following error when I try to run.
Fatal error: Call to a member function https() on a non-object in /content/HostingPlus/v/m/vmaxx.ie/web/catalog/controller/common/header.php on line 60
Can anyone explain what's wrong?
Vivian
To make this compatible with 1.4.7, in "catalog/controller/common/header.php" change the following 2 lines:-
- Code: Select all
$this->data['create'] = $this->url->https('account/create');
$this->data['account'] = $this->url->https('account/account');
To:
- Code: Select all
$this->data['create'] = HTTPS_SERVER . 'index.php?route=account/create';
$this->data['account'] = HTTPS_SERVER . 'index.php?route=account/account';
In your case, this will be lines 60 and 61.

If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
-

fido-x - Posts: 1960
- Joined: Fri Jun 27, 2008 5:09 pm
- Location: Tasmania, Australia
Re: [HOW TO] - Welcome Message / Customer Name in Header
Hi fido-x,
I have made the changes as you said but it is displaying - text_greeting [lig in] [account]
No name appearing only string name even after I log in.
After log in it displays the string name - text_logged
Vivian
I have made the changes as you said but it is displaying - text_greeting [lig in] [account]
No name appearing only string name even after I log in.
After log in it displays the string name - text_logged
Vivian
- Vivian
- Posts: 24
- Joined: Tue May 18, 2010 1:36 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
Looks like you missed a step with the language file. Put the following in "catalog/language/english/common/header.php":-
- Code: Select all
$_['text_greeting'] = 'Welcome, <strong>Guest</strong>';
$_['text_logged'] = 'Welcome back, <strong>%s</strong>';
$_['text_create'] = 'Register';
$_['text_account'] = 'Account';

If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
-

fido-x - Posts: 1960
- Joined: Fri Jun 27, 2008 5:09 pm
- Location: Tasmania, Australia
Re: [HOW TO] - Welcome Message / Customer Name in Header
Hi fido-x,
Did that but this is all that appears when page is loaded - text_greeting [ Log In ] [ text_create ]
Thanks
Vivian
Did that but this is all that appears when page is loaded - text_greeting [ Log In ] [ text_create ]
Thanks
Vivian
- Vivian
- Posts: 24
- Joined: Tue May 18, 2010 1:36 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
OK. Here's some updated instructions for OpenCart 1.4.7.
catalog/controller/common/header.php
Insert the following (around line 104):
catalog/language/english/common/header.php
Insert the following:
catalog/view/theme/default/template/common/header.tpl
Insert the following where you want the welcome message to appear:
catalog/view/theme/default/stylesheet/stylesheet.css
Give it some style (eg. margins, padding, etc.):
catalog/controller/common/header.php
Insert the following (around line 104):
- Code: Select all
// Greeting in header
if (!$this->customer->isLogged()) {
$this->data['text_greeting'] = $this->language->get('text_greeting');
} else {
$this->data['text_greeting'] = sprintf($this->language->get('text_logged'), $this->customer->getFirstName());
}
$this->data['text_create'] = $this->language->get('text_create');
$this->data['create'] = HTTPS_SERVER . 'index.php?route=account/create';
// End Greeting in header
catalog/language/english/common/header.php
Insert the following:
- Code: Select all
// Greeting Text
$_['text_greeting'] = 'Welcome, <strong>Guest</strong>';
$_['text_logged'] = 'Welcome back, <strong>%s</strong>';
$_['text_create'] = 'Register';
// End Greeting Text
catalog/view/theme/default/template/common/header.tpl
Insert the following where you want the welcome message to appear:
- Code: Select all
<div class="welcome">
<?php echo $text_greeting; ?>
<?php if (!$logged) { ?>
[ <a href="<?php echo $login; ?>"><?php echo $text_login; ?></a> ] [ <a href="<?php echo $create; ?>"><?php echo $text_create; ?></a> ]
<?php } else { ?>
[ <a href="<?php echo $logout; ?>"><?php echo $text_logout; ?></a> ] [ <a href="<?php echo $account; ?>"><?php echo $text_account; ?></a> ]
<?php } ?>
</div>
catalog/view/theme/default/stylesheet/stylesheet.css
Give it some style (eg. margins, padding, etc.):
- Code: Select all
#header .welcome {
float: left;
display: block;
margin-top: 20px;
margin-bottom: 10px;
padding-left: 0px;
}
#header .welcome a {
margin: 0px;
padding: 0px;
background: none;
}

If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
-

fido-x - Posts: 1960
- Joined: Fri Jun 27, 2008 5:09 pm
- Location: Tasmania, Australia
Re: [HOW TO] - Welcome Message / Customer Name in Header
How can we show the surname.?
welcome; name lastname
Thanks
welcome; name lastname
Thanks
-

silanli_53 - Posts: 48
- Joined: Fri Feb 19, 2010 12:54 am
Re: [HOW TO] - Welcome Message / Customer Name in Header
silanli_53 wrote:How can we show the surname.?
welcome; name lastname
Use this in the header controller (catalog/controller/common/header.php):
- Code: Select all
// Greeting in header
if (!$this->customer->isLogged()) {
$this->data['text_greeting'] = $this->language->get('text_greeting');
} else {
$this->data['text_greeting'] = sprintf($this->language->get('text_logged'), $this->customer->getFirstName() . ' ' . $this->customer->getLastName());
}
$this->data['text_create'] = $this->language->get('text_create');
$this->data['create'] = HTTPS_SERVER . 'index.php?route=account/create';
// End Greeting in header

If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
-

fido-x - Posts: 1960
- Joined: Fri Jun 27, 2008 5:09 pm
- Location: Tasmania, Australia
Re: [HOW TO] - Welcome Message / Customer Name in Header
thank you 
but why there is big space?
Welcome, Guest [........ Log In ] [........Register ]
see it live
also can you provide how to add total cart items and total cart amount? plz answer here. i dont want to H/J this post
thanks

but why there is big space?
Welcome, Guest [........ Log In ] [........Register ]
see it live
also can you provide how to add total cart items and total cart amount? plz answer here. i dont want to H/J this post
thanks
-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
51 posts
• Page 2 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 7 guests













