diff --git a/app/Http/Controllers/Shop/CategoryController.php b/app/Http/Controllers/Shop/CategoryController.php index 8da7347c..32dac31b 100644 --- a/app/Http/Controllers/Shop/CategoryController.php +++ b/app/Http/Controllers/Shop/CategoryController.php @@ -20,19 +20,37 @@ class CategoryController extends Controller public function show(Request $request, $category_id) { + switch ($request->input('article_nature')) { + case 'semences': + $product_type = 'botanic'; + $article_nature_id = 1; + break; + case 'plants': + $product_type = 'botanic'; + $article_nature_id = 2; + break; + default: + $product_type = 'botanic'; + $article_nature_id = 1; + break; + } $data = [ 'category' => Categories::getFull($category_id), 'breadcrumb' => Categories::getAncestorsByCategory($category_id), 'display_by_rows' => $request->input('display_by_rows') ?? false, - 'product_type' => $request->input('product_type') ?? 'botanic', + 'product_type' => $product_type, + 'article_nature' => $request->input('article_nature'), 'tags_selected' => $request->input('tags') ?? [], 'articles' => Articles::getArticlesToSell([ 'category_id' => $category_id, 'tags' => $request->input('tags') ?? [], - 'product_type' => $request->input('product_type') ?? 'botanic', + 'product_type' => $product_type, + 'article_nature_id' => $article_nature_id ?? false, ]), 'tags' => TagGroups::getWithTagsAndCountOffers($category_id), ]; + // dump($data); + // exit; return view('Shop.Shelves.shelve', $data); } diff --git a/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php b/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php index c14253a9..1346c755 100644 --- a/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php +++ b/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php @@ -44,7 +44,8 @@ label: '{{ __('Commander') }}', className: 'btn-success', callback: function() { - window.location = "{{ route('Shop.Orders.order') }}"; + console.log('ici'); + window.location = "{{ route('Shop.Basket.basket') }}"; } }, }; diff --git a/resources/views/Shop/Articles/partials/article.blade.php b/resources/views/Shop/Articles/partials/article.blade.php index a6f8774c..84e7d1b2 100644 --- a/resources/views/Shop/Articles/partials/article.blade.php +++ b/resources/views/Shop/Articles/partials/article.blade.php @@ -1,7 +1,7 @@ -
+
{{ $product_name }} -
+