Fix incorrect determination of booking button status

This commit is contained in:
Björn Fromme
2022-03-21 14:57:02 +01:00
parent baf2084e6e
commit f74a78d5bc
@@ -274,7 +274,12 @@ class DateService implements SingletonInterface
$nonBookableDateUids = $resolvedOptions['nonBookableDateUids'];
foreach ($dateTableData as $row) {
$showBookingButton = $resolvedOptions['showBookingButton'] || !in_array($row['dateBusProId'], $nonBookableDateUids, false);
// Default booking button status is determined by the product
$showBookingButton = $resolvedOptions['showBookingButton'];
// Check if booking button is disabled for this date
if (true === in_array($row['dateBusProId'], $nonBookableDateUids, false)) {
$showBookingButton = false;
}
$dateStart = new \DateTime($row['dateStart']);
$dateEnd = new \DateTime($row['dateEnd']);