add methods to get icon on article natures
This commit is contained in:
@@ -33,42 +33,21 @@ class CategoryController extends Controller
|
||||
]);
|
||||
if (count($articleNatures) === 1) {
|
||||
$articleNature = $articleNatures[0];
|
||||
} else {
|
||||
$articleNature = 'semences';
|
||||
}
|
||||
$productTypes = Articles::getProductTypesWithOffers([
|
||||
'category_id' => $categoryId,
|
||||
]);
|
||||
if (count($productTypes) === 1) {
|
||||
$productType = $productTypes[0];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$productType = ArticleNatures::getProductTypeBySlug($articleNature);
|
||||
}
|
||||
|
||||
switch ($articleNature) {
|
||||
case 'semences':
|
||||
$productType = 'botanic';
|
||||
$articleNatureId = 1;
|
||||
break;
|
||||
case 'plants':
|
||||
$productType = 'botanic';
|
||||
$articleNatureId = 2;
|
||||
break;
|
||||
case 'legumes':
|
||||
$productType = 'botanic';
|
||||
$articleNatureId = 3;
|
||||
break;
|
||||
default:
|
||||
if (!($productType ?? false)) {
|
||||
$productType = 'botanic';
|
||||
$articleNatureId = 1;
|
||||
$articleNature = 'semences';
|
||||
}
|
||||
break;
|
||||
}
|
||||
// $productType = ArticleNatures::getProductType($articleNatureId);
|
||||
// dump($productType);
|
||||
// dump($articleNatureId);
|
||||
// exit;
|
||||
|
||||
$articleNatureId = ArticleNatures::getIdBySlug($articleNature);
|
||||
}
|
||||
// exit;
|
||||
$data = [
|
||||
'category' => Categories::getFull($categoryId),
|
||||
'breadcrumb' => Categories::getAncestorsByCategory($categoryId),
|
||||
@@ -86,8 +65,6 @@ class CategoryController extends Controller
|
||||
]),
|
||||
'tags' => TagGroups::getWithTagsAndCountOffers($categoryId),
|
||||
];
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Shop.Shelves.shelve', $data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user