Bagaimana Anda bisa mengatur <depends>
bidang yang tidak berada dalam grup bidang yang sama
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="section" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Name</label>
<tab>tabname</tab>
<resource>Namespace_ModuleName::method</resource>
<group id="group" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General Configuration</label>
<field id="field" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
<group id="connection" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Connection Configuration</label>
<field id="disable_certificate_check" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Check</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<depends>
<field id="field">1</field>
</depends>
</field>
</group>
</section>
</system>
</config>
magento2
configuration
system.xml
St3phan
sumber
sumber
Sembunyikan Grup Konfigurasi
Untuk magento 2.1.x, Anda dapat menggunakan jQuery berikut untuk beralih Grup Konfigurasi bergantung:
Ganti id jika perlu.
sumber
sumber