Post by fido-x » Wed Oct 21, 2009 8:57 pm

I've had a few requests for this from people who have visited my dev site. Since this is not mine (it's something that was in version 0.7.7), I'm quite happy to post the necessary information to get it working.

You will need to edit the following files:–
* catalog/controller/common/header.php
* catalog/language/english/common/header.php
* catalog/view/theme/default/template/common/header.tpl
* catalog/view/theme/default/stylesheet/stylesheet.css

catalog/controller/common/header.php
Insert the following:–

Code: Select all

if (!$this->customer->isLogged()) {
	$this->data['text_greeting'] = $this->language->get('text_greeting');
} else {
	$this->load->model('account/customer');
	$customer_info = $this->model_account_customer->getCustomer($this->customer->getId());
	$this->data['text_greeting'] = sprintf($this->language->get('text_logged'), $customer_info['firstname']);
}
$this->data['text_create'] = $this->language->get('text_create');
$this->data['text_account'] = $this->language->get('text_account');
$this->data['create'] = $this->url->https('account/create');
$this->data['account'] = $this->url->https('account/account');
before:

Code: Select all

$this->id       = 'header';
(around line 31 in an unmodified setup)

catalog/language/english/common/header.php
Insert the following:–

Code: Select all

$_['text_greeting'] = 'Welcome, <strong>Guest</strong>';
$_['text_logged']   = 'Welcome back, <strong>%s</strong>';
$_['text_create']   = 'Register';
$_['text_account']  = 'Account';
before the end of the file.

catalog/view/theme/default/template/common/header.tpl
Insert the following:–

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>
before

Code: Select all

<div class="div4">
catalog/view/theme/default/stylesheet/stylesheet.css
Add the following:–

Code: Select all

#header .welcome {
	clear: both;
	margin: 10px 0px 10px 0px;
	text-align: right;
}
At the end of the file.

Enjoy!

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by web2works » Wed Nov 04, 2009 7:54 am

This is an amazing addition to an already amazing open source e-commerce CMS

thank you.

Quality Opencart Website Design - we don't just tweak a colour or two we build a fully bespoke design for OpenCart tailored for your business and target audience.
View our latest websites at: http://www.web2works.co.uk/portfolio


User avatar
Newbie

Posts

Joined
Wed Nov 04, 2009 7:39 am

Post by Franz-Peter » Thu Nov 05, 2009 11:14 pm

It would be even more amazing, if OpenCart would have a table entry for the gender of the customer as requested field. So we could use the gender and the lastname to greet the customers. Actually if we take the lastname we do not know whether it is a female or male customer. It would be also useful for customer notifications. With some firstnames how do we know what gender the person is. If a woman is ordering and I sent here a order confirmation with Mr. ... that is not very nice. Nobody knows all languages and all commom firstnames in those languages. How to decide which gender a customer belongs to?

New member

Posts

Joined
Tue Aug 25, 2009 4:30 pm

Post by Qphoria » Thu Nov 05, 2009 11:37 pm

Franz-Peter wrote:It would be even more amazing, if OpenCart would have a table entry for the gender of the customer as requested field. So we could use the gender and the lastname to greet the customers. Actually if we take the lastname we do not know whether it is a female or male customer. It would be also useful for customer notifications. With some firstnames how do we know what gender the person is. If a woman is ordering and I sent here a order confirmation with Mr. ... that is not very nice. Nobody knows all languages and all commom firstnames in those languages. How to decide which gender a customer belongs to?
You know, I remember this from ZenCart... and it was on the list of reasons why I won't go back! Too much useless crap messing up the code. Do you seriously care if it knows you are Mr or Mrs? You are Joe Customer.. thats all
Dear "Your Name" on an automated email response holds no more bearing than Dear "Mr Your last name"

I am gonna vote thumbs down on this one.

Customers are not people.. they are only money depositors and expect to be treated as such :D

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Franz-Peter » Fri Nov 06, 2009 2:29 am

Qphoria,
why should it crap the code? It is as simple as that:
add a field into the customer table and name it: gender and give it char(1) . Put a requested field into the create account ba making two radio buttons or a dropdown with two entries.
Add a little piece of code into the admin section to display the gender ( m or f). Thats it.
I know that also with oscommerce there were a lot of discussions with the customer greeting: firstname, lastname. Well we can leave it with the firstname.
But I would like to know the gender of my customers if they have questions or if I email them something about order processing. This is common courtesy. It depends on what you sell. If you sell just carots it does not matter, if you sell jewelry or valuable furniture it is a must. O0

New member

Posts

Joined
Tue Aug 25, 2009 4:30 pm

Post by Qphoria » Fri Nov 06, 2009 3:11 am

Why is it a must?

Dear Joe Customer,
How is your new sofa and chair?

Dear Pat Consumer
We hope you are enjoying your new necklace.

I see no need for it. You have their full name, you have no need to call them mr or mrs.

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Fri Nov 06, 2009 9:02 am

Franz-Peter wrote:... If a woman is ordering and I sent here a order confirmation with Mr. ... that is not very nice.
And if she's not married, getting one that says "Mrs" wouldn't be very nice either.

For the male of the species, it's simple - up until the age of 16 your title is Master, over the age of 16 you become Mister, both are abbreviated to "Mr". But for the female, it's a different situation. Until the age of 16, the title is Miss. However, over the age of 16, the title could be Miss, Mrs or Ms, depending on whether they are single, married or neutered.

Subsequently, including the gender means you would also need to include marital status and date of birth, if you want to get the title right. Information overload! Requiring this sort of information would most likely turn customers away.

Calling them by their first name is a more "personal" approach.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Fri Nov 06, 2009 11:26 am

fido-x wrote:
Franz-Peter wrote:... If a woman is ordering and I sent here a order confirmation with Mr. ... that is not very nice.
And if she's not married, getting one that says "Mrs" wouldn't be very nice either.
Exactly! Which is why its not needed at all! no mistakes, no problems.
I feel more creeped out when I see the "Mr. Blahblah"... its too personal... it emphasizes that they put focus on my family name. If i enter "Joe Schmoe" and they say "Hi Joe Schmoe" then I assume they just redisplayed what I entered.. If i see "Mr Schmoe" it makes me think they are dissecting things and amplifying my last name too much.

But eh.. its all IMO.. feel free to add it to your site.

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Fri Nov 06, 2009 12:06 pm

Franz-Peter wrote:... But I would like to know the gender of my customers if they have questions or if I email them something about order processing. This is common courtesy...
Maybe you could use a "title" field as an alternative to a "gender" field. It could be populated with "Mr, Miss, Mrs, Ms, Dr, Professor, etc." and let the customer make the choice.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Fri Nov 06, 2009 12:45 pm

Yes, I'd like to be referred to "Big Daddy" as my prefix :P

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Franz-Peter » Sat Nov 07, 2009 1:17 am

thanks Fido,

I'll try it out.

To Qphoria,
what about a more severe version (the dominatrix style) to treat customers.
We change the 'welcome customer' to something like: Take your feets from the table and get down on your knees.
And just a few changes in the language entries. We could name the payment page punishment page:
'Slave, you are allowed to use the following payment methods' or if a customer forgets to fill a required field we can also say as error message: Who did allow you to make such a mistake. 3 additional lashes (instead of coupon). Could you please provide a script for that case, which gives a few electrical shocks into the mouse or keyboard of the customer? >:D

New member

Posts

Joined
Tue Aug 25, 2009 4:30 pm

Post by fido-x » Sat Nov 07, 2009 9:45 pm

In case anyone is wondering, the instructions posted here for placing a welcome message in the header are compatible with OpenCart version 1.3.3.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by fido-x » Tue Nov 10, 2009 11:49 pm

Addendum to the above. You may have to insert the following:-

Code: Select all

$this->load->model('account/customer');
before the "if (!$this->customer->isLogged()) {" line.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Wed Nov 11, 2009 12:06 am

Franz-Peter wrote: To Qphoria,
what about a more severe version (the dominatrix style) to treat customers.
We change the 'welcome customer' to something like: Take your feets from the table and get down on your knees.
And just a few changes in the language entries. We could name the payment page punishment page:
'Slave, you are allowed to use the following payment methods' or if a customer forgets to fill a required field we can also say as error message: Who did allow you to make such a mistake. 3 additional lashes (instead of coupon). Could you please provide a script for that case, which gives a few electrical shocks into the mouse or keyboard of the customer? >:D
See! now you get it! ;D

But still, I don't know that not calling someone "Mr" is the same as treating them like a slave :P
1. "Dear Joe Idiot"
2. "Dear Mr. Joe Idiot"



But I like your idea... I think I'll start a dominatrix shop and change the wording like that.
There actually was a guy that created a device to give shocks that worked with the Unreal Tournament game. When you got shot, it would shock you. I still have it somewhere.. maybe I can modify it for ecommerce use.

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jamieleshaw » Wed Nov 11, 2009 9:27 am

That's an excellent idea:)

Active Member

Posts

Joined
Sun Jul 26, 2009 11:19 am

Post by MunDissa » Fri Nov 27, 2009 12:31 am

Works fine in 1.3.4, thanks...

Newbie

Posts

Joined
Tue Oct 20, 2009 7:02 pm

Post by lowlands » Sun Dec 20, 2009 7:55 pm

My two cents worth ...

It would be nice to be able to greet customers correctly. But much, much more important we do need to know gender and age for marketing purposes.

My OC-shop: http://www.BootBouwShop.nl - http://www.Soldeerpunt.nl


User avatar
Active Member

Posts

Joined
Sun Dec 20, 2009 8:49 am

Post by fido-x » Sun Dec 20, 2009 10:49 pm

lowlands wrote:.... But much, much more important we do need to know gender and age for marketing purposes.
Hmmm, let's see. You'll need to add a couple of extra fields to the customer table in the database, then you'll need to edit the account create and edit controllers, language and template files in the catalog, as well as the model. Then in the admin, you'll need to edit the customer controller, language and template files, as well as the model. To make it easy for your customers to enter their date of birth, it would be a good idea to include the jquery ui.datepicker in the catalog. You'll also need to change the date range in the datepicker.

Since you want it for marketing purposes, you'll also need to include filtering by date of birth and gender in the administration. Easy!

How soon do you want it?

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by fido-x » Tue Dec 22, 2009 7:52 pm

lowlands wrote:.... But much, much more important we do need to know gender and age for marketing purposes.
Well, do you want it or not?

See http://dev.fido-x.net/index.php?route=account/create for a demo. You can log in to the admin to view the administration side (filtering) with username/password demo/demo.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Yakiv » Tue Dec 22, 2009 8:35 pm

@Franz-Peter - I agree that the M / F ( Mr. / Mrs. ) is a good idea. The argument I would make against it is that often customers will make a mistake when filling out forms. If they check male when they are female and they get an e-mail from your site saying Dear Mr. Jane Doe, they're going to be mad at you and blame you for messing that up! Try to avoid such things. ...The other complication, in English anyway, is that "Mrs." refers to a married woman and "Miss" refers to an unmarried woman. And many married women refuse to go by "Ms." So, this further complicates how you could unintentionally offend your customers. Again, safer to stay away from it. ...However, it would be good to have male/female gender choice so that you could gear your marketing a little more precisely, sending out newsletters geared toward the ladies, with products they care about. Color choices / schemes in the e-mail can affect mood too. Just some thoughts. ...Thanks for the Welcome Message / Customer Name in Header, fido-x!

Active Member

Posts

Joined
Tue Dec 15, 2009 5:31 pm
Who is online

Users browsing this forum: Baidu [Spider] and 8 guests