I understand that we can create a toggle switch using form with ui_component. However, I want to create an admin configuration for my custom module using system.xml configuration.
Is there any way to apply the toogle switch (yes/no) (which is a ui_component of magento, to system.xml configuration?
I want it to be implemented instead of a select type with dropdown option.
reference: Magento 2 form field toggled type
Best Answer
After several research, I come up with this solution. (Not a clean code but still able to come up with the expected results)
I ended up creating a block to be inserted in the admin system config using the
<frontend_model/> markers
reference hereFirst, I added a
Field
insidesystem.xml
config file. It goes like this:Block file
which is theclass Advanced
codecheck.phtml
code thephtml file
Main reference for the whole idea
The output