diff --git a/Block/Checkout/LayoutProcessor.php b/Block/Checkout/LayoutProcessor.php index 7d7eaa3..4e8483c 100644 --- a/Block/Checkout/LayoutProcessor.php +++ b/Block/Checkout/LayoutProcessor.php @@ -164,6 +164,12 @@ public function getField($attributeCode, $scope) $inputType = $this->formElementMap[$inputType]; } + $validation = $attribute->getValidationRules(); + + if($attribute->getIsRequired()) { + $validation['required-entry'] = true; + } + return [ 'component' => 'Magento_Ui/js/form/element/abstract', 'config' => [ @@ -175,7 +181,7 @@ public function getField($attributeCode, $scope) 'sortOrder' => $attribute->getSortOrder(), 'visible' => true, 'provider' => 'checkoutProvider', - 'validation' => $attribute->getValidationRules(), + 'validation' => $validation, 'options' => $attribute->getOptions(), 'label' => __($attribute->getStoreLabel()) ];