Page 1 of 1

Combine first name and last name to Full name.

Posted: Sat Jun 03, 2017 3:23 pm
by phamxuanvinh2110
Combine first name and last name to Full name? Only 1 custom field Full name. I'm newbie. Help me
Thank you very much

Re: Combine first name and last name to Full name.

Posted: Sat Jun 03, 2017 3:35 pm
by opencartboost
Do you want to run query to get first name + last name as full name?
For query something like this

Code: Select all

(SELECT CONCAT(c.firstname, ' ', c.lastname) FROM " . DB_PREFIX . "customer c ) AS fullname,
or combine to variable first name + last name?
For combine variable something like this

Code: Select all

$fullname = $customer_info['firstname'] . ' ' . $customer_info['lastname'];

Re: Combine first name and last name to Full name.

Posted: Sat Jun 03, 2017 3:57 pm
by chrisranjana.com
phamxuanvinh2110 wrote:
Sat Jun 03, 2017 3:23 pm
Combine first name and last name to Full name? Only 1 custom field Full name. I'm newbie. Help me
Thank you very much
And if you need to change it in admin order information page you can edit lines 52 to 57 in the file admin/view/template/sale/order_info.tpl

Re: Combine first name and last name to Full name.

Posted: Tue Jun 13, 2017 10:12 am
by phamxuanvinh2110
I hide some "last name" in register page, checkout page... but when customer login and edit imformation, it notice error, because lose field "last name" - required.

Re: Combine first name and last name to Full name.

Posted: Tue Jun 13, 2017 10:18 am
by phamxuanvinh2110
opencartboost wrote:
Sat Jun 03, 2017 3:35 pm
Do you want to run query to get first name + last name as full name?
For query something like this

Code: Select all

(SELECT CONCAT(c.firstname, ' ', c.lastname) FROM " . DB_PREFIX . "customer c ) AS fullname,
or combine to variable first name + last name?
For combine variable something like this

Code: Select all

$fullname = $customer_info['firstname'] . ' ' . $customer_info['lastname'];
(SELECT CONCAT(c.firstname, ' ', c.lastname) FROM " . DB_PREFIX . "customer c ) AS fullname, => error.
full query extract???

Re: Combine first name and last name to Full name.

Posted: Tue Jun 13, 2017 10:28 am
by phamxuanvinh2110
Hide last name field in all page. from register, check out, admin page, ... and it dont required field. combine first and last into Full name. only field

Re: Combine first name and last name to Full name.

Posted: Thu Jun 15, 2017 4:14 pm
by sculptex
phamxuanvinh2110 wrote:
Sat Jun 03, 2017 3:23 pm
Combine first name and last name to Full name? Only 1 custom field Full name. I'm newbie. Help me
Thank you very much
As per replies, you can easily combine them for display purposes but it is not recommended for database because some payment gateways require first name and last name separate,
If you combine them you will have to pass a blank field and you are likely to have payments fail to authorise.

Re: Combine first name and last name to Full name.

Posted: Mon Jun 19, 2017 7:21 pm
by phamxuanvinh2110
I used to Ajax quick checkout, so a few profile customer is hide, but in admin order is not hide. so every edit customer's order, I must write full profile. How can I fix?