feat: info text and correct field type for service group 'VEG'
addresses #869bvch71
This commit is contained in:
@@ -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 [];
|
||||
|
||||
Reference in New Issue
Block a user