From 808e60e41b06b97b35eac4bcfbd049e374e4a545 Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Mon, 27 Feb 2023 23:16:15 +0100 Subject: [PATCH] quick add to basket on shelves --- .../Controllers/Shop/CategoryController.php | 1 - app/Repositories/Shop/Articles.php | 1 + .../Articles/partials/addBasket.blade.php | 2 + .../Shop/Articles/partials/article.blade.php | 16 ++++---- resources/views/Shop/Baskets/basket.blade.php | 2 +- .../partials/category_articles.blade.php | 41 ++++++++++++++++++- resources/views/components/card.blade.php | 4 +- 7 files changed, 53 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/Shop/CategoryController.php b/app/Http/Controllers/Shop/CategoryController.php index 6c8c9cf9..d90d9a34 100644 --- a/app/Http/Controllers/Shop/CategoryController.php +++ b/app/Http/Controllers/Shop/CategoryController.php @@ -64,7 +64,6 @@ class CategoryController extends Controller ]), 'tags' => TagGroups::getWithTagsAndCountOffers($category_id), ]; - // dump($data); return view('Shop.Shelves.shelve', $data); } diff --git a/app/Repositories/Shop/Articles.php b/app/Repositories/Shop/Articles.php index d4323f66..e81429c9 100644 --- a/app/Repositories/Shop/Articles.php +++ b/app/Repositories/Shop/Articles.php @@ -200,6 +200,7 @@ class Articles 'product_id' => $article->product_id, 'product_name' => $article->product->name, 'parent_name' => trim(str_replace($article->product->name, '', $article->name)), + 'offers' => $article->offers->toArray(), ]; } diff --git a/resources/views/Shop/Articles/partials/addBasket.blade.php b/resources/views/Shop/Articles/partials/addBasket.blade.php index 9517b470..443eed6f 100644 --- a/resources/views/Shop/Articles/partials/addBasket.blade.php +++ b/resources/views/Shop/Articles/partials/addBasket.blade.php @@ -2,6 +2,8 @@ 'id_card' => $model . '-basket', 'title' => $title, 'class' => 'mb-3 ' . ($bgClass ?? null), + 'classTitle' => 'mb-0', + 'outline' => false, ]) @include('components.form.select', [ diff --git a/resources/views/Shop/Articles/partials/article.blade.php b/resources/views/Shop/Articles/partials/article.blade.php index d3ea505e..cceae201 100644 --- a/resources/views/Shop/Articles/partials/article.blade.php +++ b/resources/views/Shop/Articles/partials/article.blade.php @@ -1,14 +1,12 @@
- -
- {{ $product_name }} -
-

-

{!! $article['description'] !!}

-
-
+
+ {{ $product_name }} +
+

+

{!! $article['description'] !!}

+
@@ -18,7 +16,7 @@
@include('Shop.Articles.partials.article_' . $product_type) -
diff --git a/resources/views/Shop/Baskets/basket.blade.php b/resources/views/Shop/Baskets/basket.blade.php index d83a6e9f..77ecfd92 100644 --- a/resources/views/Shop/Baskets/basket.blade.php +++ b/resources/views/Shop/Baskets/basket.blade.php @@ -17,7 +17,7 @@ @foreach ($basket as $nature => $items) -
+

{{ $nature }}

@foreach ($items as $item) diff --git a/resources/views/Shop/Shelves/partials/category_articles.blade.php b/resources/views/Shop/Shelves/partials/category_articles.blade.php index 0d1bd19e..c6c80c1e 100644 --- a/resources/views/Shop/Shelves/partials/category_articles.blade.php +++ b/resources/views/Shop/Shelves/partials/category_articles.blade.php @@ -6,4 +6,43 @@
@endforeach @endif -
\ No newline at end of file +
+ +@push('js') + +@endpush diff --git a/resources/views/components/card.blade.php b/resources/views/components/card.blade.php index 3e370576..b93d4d62 100644 --- a/resources/views/components/card.blade.php +++ b/resources/views/components/card.blade.php @@ -9,7 +9,7 @@ {!! $tools !!} @endisset -

{{ $title ?? false }}

+

{{ $title ?? false }}

@endisset @endif @@ -17,7 +17,7 @@ {{ $slot }} @isset($footer) -