Fix: Correctly determine conditions to show booking button in table
This commit is contained in:
@@ -198,7 +198,7 @@ class DateService implements SingletonInterface
|
||||
$nonBookableDateUids = $resolvedOptions['nonBookableDateUids'];
|
||||
|
||||
foreach ($priceTableData as $row) {
|
||||
$showBookingButton = $resolvedOptions['showBookingButton'] || !in_array($row['dateBusProId'], $nonBookableDateUids, false);
|
||||
$showBookingButton = $resolvedOptions['showBookingButton'] && !in_array($row['dateBusProId'], $nonBookableDateUids);
|
||||
|
||||
$dateStart = new \DateTime($row['dateStart']);
|
||||
$dateEnd = new \DateTime($row['dateEnd']);
|
||||
@@ -277,7 +277,7 @@ class DateService implements SingletonInterface
|
||||
// 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)) {
|
||||
if (true === in_array($row['dateBusProId'], $nonBookableDateUids)) {
|
||||
$showBookingButton = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,14 +111,8 @@
|
||||
</f:if>
|
||||
</td>
|
||||
<td class="px-2 py-1 md:p-2 whitespace-nowrap">
|
||||
<f:if condition="{row.isHideBookingButton}">
|
||||
<f:if condition="{row.showBookingButton}">
|
||||
<f:then>
|
||||
<f:link.typolink parameter="{settings.travelAlertPageUid}"
|
||||
class="button bg-button button--small">
|
||||
Reisen-Alert
|
||||
</f:link.typolink>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:if condition="{row.available}">
|
||||
<f:then>
|
||||
<a class="button bg-button button--small w-full"
|
||||
@@ -148,6 +142,12 @@
|
||||
</span>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.typolink parameter="{settings.travelAlertPageUid}"
|
||||
class="button bg-button button--small">
|
||||
Reisen-Alert
|
||||
</f:link.typolink>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user