Magento 2 has a option to extend the address field up to 4 fields.
This configuration can be found at:
Store->Configuration->Customer->Customer Configuration->Name and
Address Option
and there is a tab called Number of Lines in a Street Address.
Now all I want is to make the second field required like how the first field is required by default.
Does anyone know a solution?
Best Answer
Note that this form in the checkout is built with JavaScript / UI Components, so the solution provided by @Abhinav does not apply here (even though you should make those address fields on those other pages required as well).
The proper solution (for the checkout scenario) is to write a plugin for the layout processor and handle it from there:
In
etc/frontend/di.xml
:In
Vendor\Module\Plugin\Magento\Checkout\Block\Checkout\DirectoryDataProcessor.php
: