Im using Magento 2.2.1 and I try to customize checkout module. In order to remove unnecessary fields I added/overrided file in:
app/design/frontend/custom_template/template1/Magento_Checkout/layout/checkout_index_index.xml
with:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="checkout" xsi:type="array"> <item name="children" xsi:type="array"> <item name="steps" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shipping-step" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shippingAddress" xsi:type="array"> <item name="children" xsi:type="array"> <!-- The name of the form the field belongs to --> <item name="shipping-address-fieldset" xsi:type="array"> <item name="children" xsi:type="array"> <!--Remove fields--> <item name="region_id" xsi:type="array"> <item name="component" xsi:type="string">Magento_Ui/js/form/element/region</item> <item name="visible" xsi:type="boolean">false</item> <item name="config" xsi:type="array"> <item name="componentDisabled" xsi:type="boolean">true</item> </item> <item name="validation" xsi:type="array"> <item name="required-entry" xsi:type="boolean">false</item> </item> </item> <item name="company" xsi:type="array"> <item name="visible" xsi:type="boolean">false</item> </item> <item name="country_id" xsi:type="array"> <item name="visible" xsi:type="boolean">false</item> <item name="config" xsi:type="array"> <item name="componentDisabled" xsi:type="boolean">true</item> </item> </item> <item name="telephone" xsi:type="array"> <item name="visible" xsi:type="boolean">false</item> <item name="config" xsi:type="array"> <item name="componentDisabled" xsi:type="boolean">true</item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </argument> </arguments> </referenceBlock> </body> </page>
Unnecessary fields disappeared (even telephone stop being required) but on the last step of checkout (http://store.com/checkout/#payment) when I click button "Place Order" i get
"regionId is a required field" and I cant complete the order.
How Can I disable this field entirely?
I tried also: