Magento 2 Remove Phone Number field from checkout page

In Magento 2.2 admin panel, there is a facility to disable Phone number field. But what about in Magento 2.0?

You can do via code.

Please follow the steps.

  1. Please take a back up of  checkout_index_index.xml (vendor/magento/module-checkout/view/frontend/layout/)
  2. Copy checkout_index_index.xml to app/design/frontend/<vendor-name>/<theme-name>/Magento_Checkout/layout/
  3. Add/replace following code in checkout_index_index.xml

<item name=”telephone” xsi:type=”array”>
         <item name=”visible” xsi:type=”boolean”>false</item>
         <item name=”config” xsi:type=”array”>
                   <item name=”validation” xsi:type=”array”>
                            <item name=”componentDisabled” xsi:type=”boolean”>true</item>
                            <item name=”required-entry” xsi:type=”string”>false</item>
                   </item>
         </item>
</item>

Save this file and clear Magento cache.

You can also disable other fields from checkout page with same steps.

I hope you understand this tutorial. If you have any questions or confusion then please comment it.

 

 

 


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *