fix: 쇼핑몰 5단계 분류 경로와 서브메뉴 표시 일관성 보완
PC·basic 테마 breadcrumb를 5단계로 확장하고 기존 위치와 스타일을 유지한다. PC·모바일 서브메뉴는 5단계가 있으면 해당 목록만, 없으면 4단계 형제 목록만 표시한다. 검증: 8개 분류 경로와 네 스킨의 메뉴·선택 상태, Chromium 목록·상세 단계별 레이아웃 검사, PHP 5.2 및 현재 PHP 구문 검사 통과.
This commit is contained in:
1 parent
c4cd61c916
commit
e2d215c368
9 files changed
+252
-219
No files matched your search
+41
-1
@@ -82,9 +82,49 @@ function get_shop_navigation_data($is_cache, $ca_id, $ca_id2='', $ca_id3=''){
|
||||
}
|
||||
}
|
||||
|
||||
// 공통 전체 분류 트리는 기존 3단계 구조를 유지하고 현재 경로의 깊은 단계만 조회한다.
|
||||
for ($depth = 4; $depth <= 5 && strlen($ca_id) >= $depth * 2; $depth++) {
|
||||
$parent = substr($ca_id, 0, ($depth - 1) * 2);
|
||||
$result = sql_query(get_shop_category_sql($parent, $depth * 2));
|
||||
while ($row = sql_fetch_array($result)) {
|
||||
$row['url'] = shop_category_url($row['ca_id']);
|
||||
$datas[$depth - 1][] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
return $datas;
|
||||
}
|
||||
|
||||
// 4·5단계에서는 선택 경로의 5단계를 우선 표시하고, 없으면 4단계 형제를 표시한다.
|
||||
function get_shop_category_menu_groups($ca_id)
|
||||
{
|
||||
$length = strlen($ca_id);
|
||||
$groups = array();
|
||||
if ($length >= 8) {
|
||||
$queries = array(
|
||||
array('5단계 분류', substr($ca_id, 0, 8), 10),
|
||||
array('4단계 분류', substr($ca_id, 0, 6), 8),
|
||||
);
|
||||
} else {
|
||||
$queries = array(array('하위 분류', $ca_id, $length + 2));
|
||||
}
|
||||
foreach ($queries as $query) {
|
||||
$rows = array();
|
||||
$result = sql_query(get_shop_category_sql($query[1], $query[2]));
|
||||
while ($row = sql_fetch_array($result)) $rows[] = $row;
|
||||
if (!$rows && $length < 8) {
|
||||
$query[0] = '현재 단계 분류';
|
||||
$result = sql_query(get_shop_category_sql(substr($ca_id, 0, -2), $length));
|
||||
while ($row = sql_fetch_array($result)) $rows[] = $row;
|
||||
}
|
||||
if ($rows) {
|
||||
$groups[] = array('label' => $query[0], 'categories' => $rows);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $groups;
|
||||
}
|
||||
|
||||
function get_shop_category_by($is_cache, $case, $value){
|
||||
|
||||
if( $case === 'ca_id' ){
|
||||
@@ -268,4 +308,4 @@ function get_shop_item_options($it_id, $subject, $no)
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user