Community Forums

[HOW TO] - Welcome Message / Customer Name in Header

Free manual modifications can be contributed here. Modifications are manual snippets of code that are pasted into the forums for others to use.

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby jmrchaves » Thu Dec 24, 2009 12:13 am

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
jmrchaves
 
Posts: 3
Joined: Sun Dec 20, 2009 1:20 pm

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby Yakiv » Thu Dec 24, 2009 12:01 pm

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

Postby viniciusdepaula » Wed Dec 30, 2009 2:20 am

Great job!!!

Tks ;D
viniciusdepaula
 
Posts: 2
Joined: Tue Dec 29, 2009 5:42 pm

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby nocko » Sun Feb 07, 2010 9:00 pm

Beautiful! Thanks!
nocko
 
Posts: 24
Joined: Tue Jan 26, 2010 6:14 am

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby Cristina » Thu Feb 11, 2010 8:28 pm

GREAT JOB!! THANK YOU SO MUCH!! ;)
User avatar
Cristina
 
Posts: 21
Joined: Thu Feb 04, 2010 8:41 pm
Location: Zandvoort, The Netherlands

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby The Alchemist » Fri Feb 12, 2010 3:11 am

nice mod
User avatar
The Alchemist
 
Posts: 300
Joined: Sun Nov 22, 2009 3:04 am

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby melbagnato » Sun Feb 14, 2010 1:33 pm

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]
melbagnato
 
Posts: 10
Joined: Wed Jan 13, 2010 5:39 am
Location: Melbourne

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby The Alchemist » Mon Mar 15, 2010 4:51 am

Will this work in 1.4.0?
User avatar
The Alchemist
 
Posts: 300
Joined: Sun Nov 22, 2009 3:04 am

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby luiseduardo » Fri Mar 26, 2010 10:15 pm

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

Postby The Alchemist » Tue Mar 30, 2010 4:31 am

Plus 1 they should have a contribs section with sub sections for versions.
User avatar
The Alchemist
 
Posts: 300
Joined: Sun Nov 22, 2009 3:04 am

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby Vivian » Fri Jun 04, 2010 3:38 pm

Hi fido-x,

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

Postby Vivian » Fri Jun 04, 2010 4:28 pm

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
Vivian
 
Posts: 24
Joined: Tue May 18, 2010 1:36 am

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby fido-x » Sat Jun 05, 2010 1:32 am

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.
Image
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?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby Vivian » Sat Jun 05, 2010 9:26 am

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
Vivian
 
Posts: 24
Joined: Tue May 18, 2010 1:36 am

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby fido-x » Sun Jun 06, 2010 3:55 am

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'; 
Image
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?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby Vivian » Sun Jun 06, 2010 10:10 am

Hi fido-x,

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

Postby fido-x » Sun Jun 06, 2010 1:05 pm

OK. Here's some updated instructions for OpenCart 1.4.7.

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;
}
 
Image
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?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby silanli_53 » Thu Jul 01, 2010 12:59 am

How can we show the surname.?

welcome; name lastname



Thanks
User avatar
silanli_53
 
Posts: 48
Joined: Fri Feb 19, 2010 12:54 am

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby fido-x » Thu Jul 08, 2010 9:18 am

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   
Image
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?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [HOW TO] - Welcome Message / Customer Name in Header

Postby Maansy » Tue Jul 13, 2010 2:47 am

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
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
User avatar
Maansy
 
Posts: 930
Joined: Wed Jun 23, 2010 10:04 pm

PreviousNext

Return to Modifications

Who is online

Users browsing this forum: No registered users and 7 guests

Hosted by Arvixe Web Hosting