Post by phamxuanvinh2110 » 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

New member

Posts

Joined
Mon Nov 28, 2016 11:41 am

Post by opencartboost » 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'];

Active Member

Posts

Joined
Thu Jul 09, 2015 5:59 am

Post by chrisranjana.com » Sat Jun 03, 2017 3:57 pm

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

Chris, Opencart Developers and Programmers,
www.chrisranjana.com


User avatar
Active Member

Posts

Joined
Thu Feb 26, 2009 2:23 am
Location - chennai, India

Post by phamxuanvinh2110 » Tue Jun 13, 2017 10:12 am

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.

New member

Posts

Joined
Mon Nov 28, 2016 11:41 am

Post by phamxuanvinh2110 » Tue Jun 13, 2017 10:18 am

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

New member

Posts

Joined
Mon Nov 28, 2016 11:41 am

Post by phamxuanvinh2110 » Tue Jun 13, 2017 10:28 am

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

Attachments

lastname.png

lastname.png (133.45 KiB) Viewed 1028 times


New member

Posts

Joined
Mon Nov 28, 2016 11:41 am

Post by sculptex » Thu Jun 15, 2017 4:14 pm

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.

ImageImage


User avatar
Active Member

Posts

Joined
Tue Sep 13, 2011 3:07 am
Location - UK

Post by phamxuanvinh2110 » Mon Jun 19, 2017 7:21 pm

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?

New member

Posts

Joined
Mon Nov 28, 2016 11:41 am
Who is online

Users browsing this forum: No registered users and 3 guests