finish implementing mails
This commit is contained in:
@@ -26,11 +26,21 @@ class CategoryController extends Controller
|
||||
dump($product_type);
|
||||
exit;
|
||||
} else {
|
||||
// $product_type = Articles::getProductTypeByCategory($category_id);
|
||||
// dump($product_type);
|
||||
$article_nature = $request->input('article_nature');
|
||||
// dump($article_nature);
|
||||
// exit;
|
||||
if (!$article_nature) {
|
||||
$article_natures = Articles::getArticleNaturesWithOffers([
|
||||
'category_id' => $category_id,
|
||||
]);
|
||||
if (count($article_natures) === 1) {
|
||||
$article_nature = $article_natures[0];
|
||||
}
|
||||
$product_types = Articles::getProductTypesWithOffers([
|
||||
'category_id' => $category_id,
|
||||
]);
|
||||
if (count($product_types) === 1) {
|
||||
$product_type = $product_types[0];
|
||||
}
|
||||
}
|
||||
|
||||
switch ($article_nature) {
|
||||
case 'semences':
|
||||
@@ -46,14 +56,17 @@ class CategoryController extends Controller
|
||||
$article_nature_id = 3;
|
||||
break;
|
||||
default:
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
$article_nature = 'semences';
|
||||
if (!($product_type ?? false)) {
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
$article_nature = 'semences';
|
||||
}
|
||||
break;
|
||||
}
|
||||
// $product_type = ArticleNatures::getProductType($article_nature_id);
|
||||
// dump($product_type);
|
||||
// dump($article_nature_id);
|
||||
// exit;
|
||||
}
|
||||
// exit;
|
||||
$data = [
|
||||
@@ -62,12 +75,8 @@ class CategoryController extends Controller
|
||||
'display_by_rows' => $request->input('display_by_rows') ?? false,
|
||||
'product_type' => $product_type,
|
||||
'article_nature' => $article_nature,
|
||||
'article_natures' => Articles::getArticleNaturesWithOffers([
|
||||
'category_id' => $category_id,
|
||||
]),
|
||||
'product_types' => Articles::getProductTypesWithOffers([
|
||||
'category_id' => $category_id,
|
||||
]),
|
||||
'article_natures' => $article_natures,
|
||||
'product_types' => $product_types,
|
||||
'tags_selected' => $request->input('tags') ?? [],
|
||||
'articles' => Articles::getArticlesToSell([
|
||||
'category_id' => $category_id,
|
||||
@@ -77,6 +86,8 @@ class CategoryController extends Controller
|
||||
]),
|
||||
'tags' => TagGroups::getWithTagsAndCountOffers($category_id),
|
||||
];
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Shop.Shelves.shelve', $data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user