M2 | Can we create one field by dataprovider and one field by uicmponent in single group at Product Creation Page?

magento.stackexchange https://magento.stackexchange.com/questions/273032

Question

I have created toggle button by uicomponent in one group and some other fields by dataprovider way in another group.

Can I get toggle button into group created by dataprovider way. As it is not possible toggle checkbox to be created without uicomponent.

enter image description here

Was it helpful?

Solution

Toggle checkbox can be created via DataProvider as well. DataProvider (PHP) and UI Component (XML) files are two ways to generate the same configuration to render the elements.

Therefore you can create any kind of elements in both ways. Just need to make sure your code use the correct format and don't miss the required config.

In your case, you can try to move the config for toggle checkbox from XML file to your meta array in your DataProvider with the same key/values.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top