Skip to content

Commit 5c8bace

Browse files
author
Yuri Kovsher
committed
Merge remote-tracking branch 'tango-ce/MAGETWO-49190' into MAGETWO-48913
# Conflicts: # app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php
2 parents 3dae92d + 4db56b5 commit 5c8bace

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

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,32 @@ protected function setupMetaProperties(ProductAttributeInterface $attribute)
472472
}
473473

474474
$meta = $this->addWysiwyg($attribute, $meta);
475+
$meta = $this->customizeCheckbox($attribute, $meta);
475476
$meta = $this->customizePriceAttribute($attribute, $meta);
476477

477478
return $meta;
478479
}
479480

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+
480501
/**
481502
* Customize attribute that has price type
482503
*

0 commit comments

Comments
 (0)