feat: align rendering of pickups field with other services
This commit is contained in:
@@ -407,12 +407,11 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
|
|||||||
$this->fieldOptionProviders['pickup'] = fn (BookingDto $bookingDto, int $participantIndex, array $options = []) => [
|
$this->fieldOptionProviders['pickup'] = fn (BookingDto $bookingDto, int $participantIndex, array $options = []) => [
|
||||||
'label' => 'Zu- und Ausstieg',
|
'label' => 'Zu- und Ausstieg',
|
||||||
'choices' => $bookingDto->travel->pickupsOutbound,
|
'choices' => $bookingDto->travel->pickupsOutbound,
|
||||||
'choice_label' => fn (?Pickup $pickup) => $this->formatPickupLabelWithPrice($pickup),
|
'choice_label' => fn (?Pickup $pickup) => $pickup?->getLabel(),
|
||||||
'choice_value' => 'id',
|
'choice_value' => 'id',
|
||||||
'expanded' => false, // Dropdown for pickups
|
'expanded' => true, // Radio buttons in table layout like other services
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'placeholder' => 'Zu- und Ausstieg auswählen',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Parking (conditional - only shown when outbound transportation is PKW)
|
// Parking (conditional - only shown when outbound transportation is PKW)
|
||||||
@@ -618,15 +617,6 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
|
|||||||
return sprintf('%s (€%s)', $service->label, number_format($service->price, 2, ',', '.'));
|
return sprintf('%s (€%s)', $service->label, number_format($service->price, 2, ',', '.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function formatPickupLabelWithPrice(?Pickup $pickup): string
|
|
||||||
{
|
|
||||||
if (null === $pickup) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $pickup->getLabelWithPrice();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the parking checkbox label with pricing information.
|
* Gets the parking checkbox label with pricing information.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user