0

I need remove from customer addresses the next attributes: Prefix, Middle name and Suffix.

enter image description here

How I do this?

1

Create customer_form.xml file to custom module

app/code/Vendor/Module/view/adminhtml/ui_component/customer_form.xml

With below code

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="address">
        <field name="prefix" formElement="input">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </field>
    <field name="middlename" formElement="input">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </field>
    <field name="suffix" formElement="input">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </field>
    </fieldset>
</form>

It would be remove above fields from customer address in Admin.

  • Nice, it work, but i remove formElement="input", this gave me error. I don't know the motive – chdzma Jul 13 '18 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.