$categoryId, ]); $articleNatures = Articles::getArticleNaturesWithOffers([ 'category_id' => $categoryId, ]); if ($articleNatureId) { $productType = ArticleNatures::getProductType($articleNatureId); } else { if (! $articleNature) { if (count($articleNatures)) { $articleNature = $articleNatures[0]; } } $productType = ArticleNatures::getProductTypeBySlug($articleNature); $articleNatureId = ArticleNatures::getIdBySlug($articleNature); } return [ 'category' => Categories::getFull($categoryId), 'breadcrumb' => Categories::getAncestorsByCategory($categoryId), 'display_by_rows' => $displayByRows, 'product_type' => $productType, 'article_nature' => $articleNature, 'article_natures' => $articleNatures ?? [], 'product_types' => $productTypes ?? [], 'tags_selected' => $tags, 'articles' => Articles::getArticlesToSell([ 'category_id' => $categoryId, 'tags' => $tags, 'product_type' => $productType ?? false, 'article_nature_id' => $articleNatureId ?? false, ]), 'tags' => TagGroups::getWithTagsAndCountOffers($categoryId), ]; } }