home calendar-strip - manage bookable stock
This commit is contained in:
parent
adff8b9ab7
commit
f35c74047d
2 changed files with 13 additions and 6 deletions
|
|
@ -72,6 +72,7 @@ return [
|
|||
$eventDateId = explode('/', $session->{'@id'});
|
||||
$eventDateId = $eventDateId[count($eventDateId) - 1];
|
||||
$ticketingUrl = option('ticketingUrl') . 'event/' . $mapadoEvent->slug . '?eventDate=' . $eventDateId;
|
||||
$bookableStock = $session->notInStockContingentBookableStock;
|
||||
|
||||
if (isset($session->endDate) && !$duration) {
|
||||
$endTime = substr($session->endDate, 11 , 5);
|
||||
|
|
@ -85,7 +86,8 @@ return [
|
|||
"duration" => $duration,
|
||||
"place" => $event->place()->value(),
|
||||
"eventUrl" => $event->url(),
|
||||
"ticketingUrl" => $ticketingUrl
|
||||
"ticketingUrl" => $ticketingUrl,
|
||||
"bookableStock" => $bookableStock
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
targetSessions: [],
|
||||
open: false,
|
||||
today: dayjs().format('DD-MM-YYYY'),
|
||||
stockThreshold: <?= option('stockThreshold') ?>,
|
||||
|
||||
get monthName() {
|
||||
return dayjs().month(this.monthNumb).format('MMMM');
|
||||
|
|
@ -76,16 +77,20 @@
|
|||
</div>
|
||||
<div x-text="`${session.duration}`"></div>
|
||||
<div x-text="`${session.place}`"></div>
|
||||
<template x-if="session.ticketingUrl">
|
||||
<div class="session__info">
|
||||
<a class="ticket-link" :href="session.ticketingUrl" target="_blank" title="Aller à la billetterie"><?php snippet('ticket') ?> Billetterie</a>
|
||||
</div>
|
||||
</template>
|
||||
<template x-if="!session.ticketingUrl">
|
||||
<div class="session__info">
|
||||
<a class="ticket-link" target="_blank" title="Entrée libre" disabled><?php snippet('ticket') ?> Entrée libre</a>
|
||||
</div>
|
||||
</template>
|
||||
<template x-if="session.bookableStock === 0">
|
||||
<a class="ticket-link" title="Plus de places disponibles" disabled><?php snippet('ticket') ?> Complet</a>
|
||||
</template>
|
||||
<template x-if="session.bookableStock > stockThreshold">
|
||||
<a class="ticket-link" title="Plateforme de réservation" :href="session.ticketingUrl" target="_blank"><?php snippet('ticket') ?> Billetterie</a>
|
||||
</template>
|
||||
<template x-if="session.bookableStock !== 0 && session.bookableStock < stockThreshold">
|
||||
<a class="ticket-link" title="Plateforme de réservation" :href="session.ticketingUrl" target="_blank"><?php snippet('ticket') ?> Plus que quelques places !</a>
|
||||
</template>
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue