In Magento 2.1.2

How to remove billing address lastname field and shipping address lastname field ?

I update to eav_attribute table. UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname' and entity_type_id = 1; and I removed vendor/magento/module-customer/view/frontend/templates/widget/name.phtml

The lastname is valid, but the billing address and the delivery address are invalid.

Does anyone know this ?


If you are using the Magento Onepage Checkout, I believe this is going to fall under a js file.

Checkout -> view -> frontend -> web -> js (folder)

You can start with checkout-data.js but you will also have to modify corresponding files (files that are passed the billing address last name and shipping address last name fields) if you want it completely removed from the app (meaning not throwing a "This is a required field." error)

It may be easier to try and find an extension that can do this for you.

  1. Find the relevant attribute id from eav_attribute
  2. Delete the record from customer_form_attribute. delete from customer_form_attribute where attribute_id=25 and form_code='customer_register_address';

Your Answer

