@if (($shop_config->category_layout ?? 'top') !== 'side' && count($shop_categories ?? []))
@php
// 1차 카테고리를 열로 세우고 하위는 그 아래에 모은다
$shp_cat_cols = [];
$shp_cat_cur = -1;
foreach ($shop_categories as $shp_c) {
if ((int)($shp_c->depth ?? 0) === 0) {
$shp_cat_cols[] = ['top' => $shp_c, 'children' => []];
$shp_cat_cur = count($shp_cat_cols) - 1;
} elseif ($shp_cat_cur >= 0) {
$shp_cat_cols[$shp_cat_cur]['children'][] = $shp_c;
}
}
@endphp
@foreach ($shp_cat_cols as $shp_col)
@endforeach
@endif
@if (count($home_banners))
@if (count($home_banners) > 1)
@foreach ($home_banners as $shp_di => $shp_dv)
@endforeach
@endif
@endif
@php
$shp_main_promos = array_values(array_filter($home_promotions ?? [], function($pm) {
return ($pm->banner_data['main'] ?? 'N') === 'Y' && !empty($pm->banner_data['logo']);
}));
@endphp
@if (count($shp_main_promos))
@endif
@php $shp_side_cats = ($shop_config->category_layout ?? 'top') === 'side' && count($shop_categories ?? []); @endphp
@if ($shp_side_cats)
@include('_sidecats')
@endif
@if (count($home_promotions ?? []))
@endif
@foreach ($home_sections as $section)
@endforeach