{ Hello Magento 2 }

解决 Magento 2 应用问题,更注重深度挖掘。(ง •̀_•́)ง

0%

隐藏 Magento 2 管理后台的 middle name

管理后台的数据是通过 UI component 加载的。
隐藏 customer 和 customer address 的 middlename

File: app\code\Vendor\ModuleName\view\base\ui_component\customer_form.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?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="customer">
<field name="middlename" formElement="input">
<settings>
<visible>false</visible>
</settings>
</field>
</fieldset>
<fieldset name="address">
<field name="middlename" formElement="input">
<settings>
<visible>false</visible>
</settings>
</field>
</fieldset>
</form>