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 @@ -472,11 +472,32 @@ protected function setupMetaProperties(ProductAttributeInterface $attribute)
472
472
}
473
473
474
474
$ meta = $ this ->addWysiwyg ($ attribute , $ meta );
475
+ $ meta = $ this ->customizeCheckbox ($ attribute , $ meta );
475
476
$ meta = $ this ->customizePriceAttribute ($ attribute , $ meta );
476
477
477
478
return $ meta ;
478
479
}
479
480
481
+ /**
482
+ * Customize checkboxes
483
+ *
484
+ * @param ProductAttributeInterface $attribute
485
+ * @param array $meta
486
+ * @return array
487
+ */
488
+ private function customizeCheckbox (ProductAttributeInterface $ attribute , array $ meta )
489
+ {
490
+ if ($ attribute ->getFrontendInput () === 'boolean ' ) {
491
+ $ meta ['arguments ' ]['data ' ]['config ' ]['prefer ' ] = 'toggle ' ;
492
+ $ meta ['arguments ' ]['data ' ]['config ' ]['valueMap ' ] = [
493
+ 'true ' => '1 ' ,
494
+ 'false ' => '0 ' ,
495
+ ];
496
+ }
497
+
498
+ return $ meta ;
499
+ }
500
+
480
501
/**
481
502
* Customize attribute that has price type
482
503
*
You can’t perform that action at this time.
0 commit comments