D
D
danforth2016-04-21 13:14:10
Magento
danforth, 2016-04-21 13:14:10

Magento 2 - checkout and required fields, how to change?

Hello. I installed the Magento 2 version, I like everything, except for the order form.
In the battle for the conversion rate in the CIS countries, everyone is trying to make ordering as simple as possible. At the moment, there are a lot of mandatory fields in the form, such as city, region, etc.
I need to make the following required fields:
- Phone
And these fields should be visible, but not required :
- First and last name
- City
- e-mail
What I did:
I tried to edit the file ../vendor/magento/module-checkout/view/frontend/layout/checkout_index_index.xml
There you can specify hidden fields by specifying the attribute

<item name="visible" xsi:type="boolean">false</item>
.
For the fax and company fields, this helped, but for the Region / State fields it does not work, apparently, they are loaded in a different place.
Also, this construction does not remove from the required field, i.e. it's still being checked.
<item name="validation" xsi:type="array">
     <item name="required-entry" xsi:type="string">false</item>
</item>

Is there a way to quickly disable unnecessary fields without learning Zend or getting a Magento certification? I understand that the engine is serious and not push-button, but now only a simplified basket is missing to launch the project.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2016-10-11
@springimport

Firstly, you understand that these files should not be edited, right?
But in fact, this is a layout, and you need to look for a form. But first, I would go through all the settings in the admin panel. Usually such things are already provided.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question