@version(2) @load('css/shop.css')
@php $shp_page_title = $lang->shop_all_items ?? '전체 상품'; $shp_filter = Context::get('current_filter') ?: ''; if ($current_category) { foreach ($shop_categories as $shp_tc) { if ((int)$shp_tc->category_srl === $current_category) { $shp_page_title = $shp_tc->title; break; } } } elseif ($shp_filter === 'recommend') { $shp_page_title = $lang->shop_home_recommend; } elseif ($shp_filter === 'new') { $shp_page_title = $lang->shop_home_new; } elseif ($shp_filter === 'popular') { $shp_page_title = $lang->shop_home_popular; } elseif ($shp_filter === 'sale') { $shp_page_title = $lang->shop_home_sale; } @endphp

{{ $shp_page_title }}

@php $shp_bc = []; if ($current_category) { $shp_bc_map = []; foreach ($shop_categories as $shp_bc_c) { $shp_bc_map[(int)$shp_bc_c->category_srl] = $shp_bc_c; } $shp_bc_cur = $current_category; $shp_bc_guard = 0; while ($shp_bc_cur > 0 && isset($shp_bc_map[$shp_bc_cur]) && $shp_bc_guard++ < 10) { array_unshift($shp_bc, $shp_bc_map[$shp_bc_cur]); $shp_bc_cur = (int)$shp_bc_map[$shp_bc_cur]->parent_srl; } } @endphp
@include('_currency') {{ $lang->shop_my_orders }} {{ $lang->shop_cart }} @if ($cart_count > 0){{ $cart_count }}@endif
@php $shp_side_cats = ($shop_config->category_layout ?? 'top') === 'side' && count($shop_categories ?? []); @endphp @php // 카테고리 칩: 1차는 항상, 하위는 고른 1차 밑에서만 보여 준다 $shp_chip_tops = []; $shp_chip_subs = []; $shp_chip_cur_top = 0; $shp_chip_parent = -1; foreach ($shop_categories as $shp_cc) { if ((int)($shp_cc->depth ?? 0) === 0) { $shp_chip_tops[] = $shp_cc; $shp_chip_parent = (int)$shp_cc->category_srl; if ((int)$shp_cc->category_srl === $current_category) { $shp_chip_cur_top = $shp_chip_parent; } } else { if ((int)$shp_cc->category_srl === $current_category) { $shp_chip_cur_top = $shp_chip_parent; } $shp_chip_subs[$shp_chip_parent][] = $shp_cc; } } @endphp @if (!$shp_side_cats && count($shp_chip_tops)) @if ($shp_chip_cur_top > 0 && count($shp_chip_subs[$shp_chip_cur_top] ?? [])) @endif @endif
@if ($shp_filter !== '')@endif @foreach (['display' => $lang->shop_sort_display, 'new' => $lang->shop_sort_new, 'popular' => $lang->shop_sort_popular, 'price_low' => $lang->shop_sort_price_low, 'price_high' => $lang->shop_sort_price_high] as $key => $label) {{ $label }} @endforeach
@if ($shp_side_cats) @include('_sidecats') @endif