$this->
addFlash(self::SUCCESS,
$this->
trans('account.optInGuestAlert'
));
return true;
} private function getAdditionalRegisterValidationDefinitions(DataBag
$data, SalesChannelContext
$context): DataValidationDefinition
{ $definition =
new DataValidationDefinition('storefront.confirmation'
);
if ($this->systemConfigService->
get('core.loginRegistration.requireEmailConfirmation',
$context->
getSalesChannel()->
getId())) { $definition->
add('emailConfirmation',
new NotBlank(),
new EqualTo([ 'value' =>
$data->
get('email'
),
]));
} if ($data->
has('guest'
)) { return $definition;
} if ($this->systemConfigService->
get('core.loginRegistration.requirePasswordConfirmation',
$context->
getSalesChannel()->
getId())) { $definition->
add('passwordConfirmation',
new NotBlank(),
new EqualTo([ 'value' =>
$data->
get('password'
),
]));