File tree 1 file changed +21
-0
lines changed
app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -462,6 +462,27 @@ protected function setupMetaProperties(ProductAttributeInterface $attribute)
462
462
}
463
463
464
464
$ meta = $ this ->addWysiwyg ($ attribute , $ meta );
465
+ $ meta = $ this ->customizeCheckbox ($ attribute , $ meta );
466
+
467
+ return $ meta ;
468
+ }
469
+
470
+ /**
471
+ * Customize checkboxes
472
+ *
473
+ * @param ProductAttributeInterface $attribute
474
+ * @param array $meta
475
+ * @return array
476
+ */
477
+ private function customizeCheckbox (ProductAttributeInterface $ attribute , array $ meta )
478
+ {
479
+ if ($ attribute ->getFrontendInput () === 'boolean ' ) {
480
+ $ meta ['arguments ' ]['data ' ]['config ' ]['prefer ' ] = 'toggle ' ;
481
+ $ meta ['arguments ' ]['data ' ]['config ' ]['valueMap ' ] = [
482
+ 'true ' => '1 ' ,
483
+ 'false ' => '0 ' ,
484
+ ];
485
+ }
465
486
466
487
return $ meta ;
467
488
}
You can’t perform that action at this time.
0 commit comments