fix layout

This commit is contained in:
Ludovic CANDELLIER
2022-12-21 18:33:15 +01:00
parent 73ed46bc28
commit 5151f393be
16 changed files with 164 additions and 135 deletions

View File

@@ -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);
}