главная добита по визуалу
This commit is contained in:
@@ -47,44 +47,6 @@ final class HomeController
|
||||
'kind' => 'new',
|
||||
'products' => $productRepository->newPreview(10),
|
||||
];
|
||||
|
||||
foreach ([
|
||||
['slugs' => ['ikra'], 'title' => 'Икра'],
|
||||
['slugs' => ['ryba'], 'title' => 'Рыба'],
|
||||
['slugs' => ['moreprodukty'], 'title' => 'Морепродукты'],
|
||||
['slugs' => ['myaso'], 'title' => 'Мясо'],
|
||||
['slugs' => ['polufabrikaty'], 'title' => 'Полуфабрикаты'],
|
||||
['slugs' => ['syry'], 'title' => 'Сыры'],
|
||||
['slugs' => ['frukty-ovoschi-yagody-griby'], 'title' => 'Фрукты, овощи, ягоды, грибы'],
|
||||
['slugs' => ['mramornaya-govyadina'], 'title' => 'Мраморная говядина'],
|
||||
['slugs' => ['kopchenaya-ryba', 'kopchenaya-riba-1'], 'title' => 'Копченая рыба'],
|
||||
['slugs' => ['vyalenaya-ryba', 'vylaenaya-riba'], 'title' => 'Вяленая рыба'],
|
||||
['slugs' => ['malosolnaya-ryba', 'malosolnaya-riba'], 'title' => 'Малосольная рыба'],
|
||||
] as $sectionConfig) {
|
||||
$categoryMatch = $this->homeCategoryShowcase(
|
||||
$categoryRepository,
|
||||
$productRepository,
|
||||
$categories,
|
||||
$sectionConfig['slugs'],
|
||||
$sectionConfig['title']
|
||||
);
|
||||
|
||||
if ($categoryMatch === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$category = $categoryMatch['category'];
|
||||
$showcase = $categoryMatch['showcase'];
|
||||
$slug = (string) ($sectionConfig['slugs'][0] ?? $category['slug']);
|
||||
$homeCatalogSections[] = [
|
||||
'key' => $slug,
|
||||
'title' => $sectionConfig['title'],
|
||||
'url' => '/catalog/' . $category['slug'],
|
||||
'count' => $showcase['total'],
|
||||
'kind' => 'category',
|
||||
'products' => $showcase['products'],
|
||||
];
|
||||
}
|
||||
$settings = (new SettingRepository())->allKeyed();
|
||||
} catch (Throwable $exception) {
|
||||
$dbStatus = app_env('APP_DEBUG', 'false') === 'true'
|
||||
|
||||
Reference in New Issue
Block a user