fix: add "Bientôt disponible" box on public product page without prices
This commit is contained in:
@@ -1,37 +1,59 @@
|
|||||||
@if ($article['offers']['semences'] ?? false)
|
@php
|
||||||
@include('Shop.Articles.partials.addBasket', [
|
// Check if article is not visible OR has no offers at all
|
||||||
'data' => $article['offers']['semences'],
|
$hasNoOffers = empty($article['offers']['semences'] ?? false)
|
||||||
'title' => 'Semences',
|
&& empty($article['offers']['plants'] ?? false)
|
||||||
'model' => 'semences',
|
&& empty($article['offers']['legumes'] ?? false)
|
||||||
'bgClass' => 'bg-green-light',
|
&& empty($article['offers']['marchandise'] ?? false);
|
||||||
])
|
$shouldShowComingSoon = !($article['visible'] ?? true) || $hasNoOffers;
|
||||||
@endif
|
@endphp
|
||||||
|
|
||||||
@if ($article['offers']['plants'] ?? false)
|
@if ($shouldShowComingSoon)
|
||||||
@include('Shop.Articles.partials.addBasket', [
|
{{-- Display "Coming Soon" box when article is not visible or has no offers --}}
|
||||||
'data' => $article['offers']['plants'],
|
<div class="card border-info">
|
||||||
'title' => 'Plants',
|
<div class="card-body text-center p-4">
|
||||||
'model' => 'plants',
|
<h4 class="text-info mb-3">
|
||||||
'bgClass' => 'bg-green-light',
|
<i class="fas fa-clock"></i>
|
||||||
])
|
</h4>
|
||||||
@endif
|
<h5 class="card-title mb-0">Bientôt disponible</h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
{{-- Display normal offers for visible articles with available offers --}}
|
||||||
|
@if ($article['offers']['semences'] ?? false)
|
||||||
|
@include('Shop.Articles.partials.addBasket', [
|
||||||
|
'data' => $article['offers']['semences'],
|
||||||
|
'title' => 'Semences',
|
||||||
|
'model' => 'semences',
|
||||||
|
'bgClass' => 'bg-green-light',
|
||||||
|
])
|
||||||
|
@endif
|
||||||
|
|
||||||
@if ($article['offers']['legumes'] ?? false)
|
@if ($article['offers']['plants'] ?? false)
|
||||||
@include('Shop.Articles.partials.addBasket', [
|
@include('Shop.Articles.partials.addBasket', [
|
||||||
'data' => $article['offers']['legumes'],
|
'data' => $article['offers']['plants'],
|
||||||
'title' => 'Légumes',
|
'title' => 'Plants',
|
||||||
'model' => 'legumes',
|
'model' => 'plants',
|
||||||
'bgClass' => 'bg-green-light',
|
'bgClass' => 'bg-green-light',
|
||||||
])
|
])
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($article['offers']['marchandise'] ?? false)
|
@if ($article['offers']['legumes'] ?? false)
|
||||||
@include('Shop.Articles.partials.addBasket', [
|
@include('Shop.Articles.partials.addBasket', [
|
||||||
'data' => $article['offers']['marchandise'],
|
'data' => $article['offers']['legumes'],
|
||||||
'title' => 'Marchandises',
|
'title' => 'Légumes',
|
||||||
'model' => 'marchandise',
|
'model' => 'legumes',
|
||||||
'bgClass' => 'bg-green-light',
|
'bgClass' => 'bg-green-light',
|
||||||
])
|
])
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($article['offers']['marchandise'] ?? false)
|
||||||
|
@include('Shop.Articles.partials.addBasket', [
|
||||||
|
'data' => $article['offers']['marchandise'],
|
||||||
|
'title' => 'Marchandises',
|
||||||
|
'model' => 'marchandise',
|
||||||
|
'bgClass' => 'bg-green-light',
|
||||||
|
])
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@include('load.basket')
|
@include('load.basket')
|
||||||
|
|||||||
Reference in New Issue
Block a user