diff --git a/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php b/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php index a0a3b8d9..22dcb3f4 100644 --- a/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php +++ b/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php @@ -1,37 +1,59 @@ -@if ($article['offers']['semences'] ?? false) - @include('Shop.Articles.partials.addBasket', [ - 'data' => $article['offers']['semences'], - 'title' => 'Semences', - 'model' => 'semences', - 'bgClass' => 'bg-green-light', - ]) -@endif +@php + // Check if article is not visible OR has no offers at all + $hasNoOffers = empty($article['offers']['semences'] ?? false) + && empty($article['offers']['plants'] ?? false) + && empty($article['offers']['legumes'] ?? false) + && empty($article['offers']['marchandise'] ?? false); + $shouldShowComingSoon = !($article['visible'] ?? true) || $hasNoOffers; +@endphp -@if ($article['offers']['plants'] ?? false) - @include('Shop.Articles.partials.addBasket', [ - 'data' => $article['offers']['plants'], - 'title' => 'Plants', - 'model' => 'plants', - 'bgClass' => 'bg-green-light', - ]) -@endif +@if ($shouldShowComingSoon) + {{-- Display "Coming Soon" box when article is not visible or has no offers --}} +
+
+

+ +

+
Bientôt disponible
+
+
+@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) - @include('Shop.Articles.partials.addBasket', [ - 'data' => $article['offers']['legumes'], - 'title' => 'Légumes', - 'model' => 'legumes', - 'bgClass' => 'bg-green-light', - ]) -@endif + @if ($article['offers']['plants'] ?? false) + @include('Shop.Articles.partials.addBasket', [ + 'data' => $article['offers']['plants'], + 'title' => 'Plants', + 'model' => 'plants', + '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', - ]) + @if ($article['offers']['legumes'] ?? false) + @include('Shop.Articles.partials.addBasket', [ + 'data' => $article['offers']['legumes'], + 'title' => 'Légumes', + 'model' => 'legumes', + '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 @include('load.basket')