How to remove Company field from checkout process in Magento 2? I've been looking for the template but have not found it.
Update: Is there any way to remove this field via layout or template?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityHow to remove Company field from checkout process in Magento 2? I've been looking for the template but have not found it.
Update: Is there any way to remove this field via layout or template?
Temporarily, we should try:
<item name="company" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
</item>
For example, in app/design/frontend/{Vendor Theme}/{Theme}/Magento_Checkout/layout/checkout_index_index.xml
, find the component that you need to customize. Copy the corresponding node and all parent nodes up to . We're going to remove/disable telephone and company fields:
<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="telephone" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
</item>
<item name="company" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
[EDIT]:
From Magento 2.2.x
STORES > Configuration > Customersmers > Customer Configuration > Name and Address Options > Show Company > No
I have hide the company field in **Magento 2.1**
using below steps:
Copy handle file in app/design/frontend/PackageName/ThemeName/Magento_Checkout/layout/checkout_index_index.xml
replace the below code:
<item name="company" xsi:type="array">
<item name="validation" xsi:type="array">
<item name="min_text_length" xsi:type="number">0</item>
</item>
</item>
with
<item name="company" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
<item name="validation" xsi:type="array">
<item name="min_text_length" xsi:type="number">0</item>
</item>
</item>
<item name="visible" xsi:type="boolean">false</item>
There is no need for coding,simply go to Stores > Configuration > Cutomers > Customer Configuration then in Name and Address Options You set Show Company to No
You should try to set false to visible attribute:
<item name="company" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
</item>
Go to vendor / magento / module-checkout / view / frontend / layout / checkout_index_index.xml
find:
<item name="company" xsi:type="array">
<item name="validation" xsi:type="array">
<item name="min_text_length" xsi:type="number">0</item>
</item>
</item>
Replace:
<item name="company" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
<item name="validation" xsi:type="array">
<item name="min_text_length" xsi:type="number">0</item>
</item>
</item>
If you want to merely disable a field instead of removing it altogether use this:
<item name="company" xsi:type="array">
<item name="config" xsi:type="array">
<item name="disabled" xsi:type="boolean">true</item>
</item>
</item>
Note: I know this is not what OP is asking for but I'm just putting it here in case anyone finds it helpful.
form id="co-shipping-form"
. Code for commpany field:<div class="field" name="shippingAddress.company" data-bind="visible: visible, attr: {'name': element.dataScope}, css: additionalClasses">"