2

in magento2 , How to remove last name ,Only first name is retained.

I see magento1.x have such a plugins.

0

You can run below query in your database for set lastname as optional for customer.

UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname' and entity_type_id = 1

Go to below file where you can find class field-name-lastname in code. delete complete this div for last name.

vendor\magento\module-customer\view\frontend\templates\widget\name.phtml

You can copy the file to your custom theme or module and change accordingly. Not recommended to change directly in core module.

| improve this answer | |
  • 2.1.2 , I did not find this directory vendor/magento/module-customer – Patrick-Peng Oct 25 '16 at 14:38
  • I just downloaded and able to see Magento-CE-2.1.2_sample_data-2016-10-11-11-27-51\vendor\magento\module-customer\view – Krishna ijjada Oct 25 '16 at 14:40
  • hello, I download new version magento 2.12, I looked module-customer/view/nam.phtml/ . I want to ask you , The checkout page, how to remove last name field . – Patrick-Peng Oct 26 '16 at 13:34
  • hello,how to remove The billing address shipping address last name ? – Patrick-Peng Nov 3 '16 at 1:11
  • Hi krishna, i need to remove it, only in checkout page – shivashankar m May 15 '18 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.