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'];
|
$nonBookableDateUids = $resolvedOptions['nonBookableDateUids'];
|
||||||
|
|
||||||
foreach ($priceTableData as $row) {
|
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']);
|
$dateStart = new \DateTime($row['dateStart']);
|
||||||
$dateEnd = new \DateTime($row['dateEnd']);
|
$dateEnd = new \DateTime($row['dateEnd']);
|
||||||
@@ -277,7 +277,7 @@ class DateService implements SingletonInterface
|
|||||||
// Default booking button status is determined by the product
|
// Default booking button status is determined by the product
|
||||||
$showBookingButton = $resolvedOptions['showBookingButton'];
|
$showBookingButton = $resolvedOptions['showBookingButton'];
|
||||||
// Check if booking button is disabled for this date
|
// 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;
|
$showBookingButton = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,14 +111,8 @@
|
|||||||
</f:if>
|
</f:if>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 py-1 md:p-2 whitespace-nowrap">
|
<td class="px-2 py-1 md:p-2 whitespace-nowrap">
|
||||||
<f:if condition="{row.isHideBookingButton}">
|
<f:if condition="{row.showBookingButton}">
|
||||||
<f:then>
|
<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:if condition="{row.available}">
|
||||||
<f:then>
|
<f:then>
|
||||||
<a class="button bg-button button--small w-full"
|
<a class="button bg-button button--small w-full"
|
||||||
@@ -148,6 +142,12 @@
|
|||||||
</span>
|
</span>
|
||||||
</f:else>
|
</f:else>
|
||||||
</f:if>
|
</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:else>
|
||||||
</f:if>
|
</f:if>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user