feat: info text and correct field type for service group 'VEG'

addresses #869bvch71
This commit is contained in:
Björn Fromme
2026-03-16 12:02:59 +01:00
parent 1e653e213a
commit aa3b23ecb8
5 changed files with 66 additions and 29 deletions
@@ -258,7 +258,7 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
];
};
// Veg (vegetarian/vegan) field provider - provides dietary preference options as radio buttons (mutually exclusive)
// Veg (vegetarian/vegan) field provider - provides dietary preference options as dropdown
// Returns empty array when no dietary options available
$this->fieldOptionProviders['veg'] = function (BookingDto $bookingDto, int $participantIndex, array $options = []): array {
$choices = $this->filterServicesByAgeConstraints(
@@ -274,11 +274,21 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
return [
'label' => 'Verpflegungswunsch',
'multiple' => false,
'expanded' => true,
'expanded' => false,
'required' => false,
'placeholder' => 'Verpflegungswunsch...',
'choices' => $choices,
'choice_value' => 'id',
'choice_label' => fn (?Service $service) => $service?->label,
'choice_label' => function (?Service $service): ?string {
if (null === $service) {
return null;
}
$priceLabel = (null === $service->price || 0.0 === $service->price)
? 'inkl.'
: number_format($service->price, 2, ',', '.') . ' €';
return $service->label . ' (' . $priceLabel . ')';
},
'choice_attr' => function (?Service $service) use ($bookingDto, $participantIndex) {
if (null === $service) {
return [];