
질문과 답변
2025.11.06 15:23
상품구매 페이지 서브 카테고리 변경 문의
위에 이미지처럼 안나오고 아래 이미지처럼 나오네요 뭐가 문제인가요?

<?php if (empty($_GET['it_id'])): ?>
<li class="gnb_sub_div_ul1_li1">
<?php
// 현재 선택된 1차 카테고리 (ca_id 앞 2자리)
$current_1st = !empty($_GET['ca_id']) ? substr($_GET['ca_id'], 0, 2) : '';
// 1차 카테고리 조회
$sql_1st = "SELECT ca_id, ca_name
FROM {$g5['g5_shop_category_table']}
WHERE LENGTH(ca_id) = 2 AND ca_use = '1'
ORDER BY ca_order, ca_id";
$result_1st = sql_query($sql_1st);
$has_category = false;
?>
<ul class="swiper-container swiper-container-sgnb">
<ul class="swiper-wrapper swiper-wrapper-sgnb">
<?php
while ($row = sql_fetch_array($result_1st)) {
$has_category = true;
$link = G5_SHOP_URL . '/list.php?ca_id=' . $row['ca_id'];
$is_active = ($current_1st === $row['ca_id']) ? 'top_ons' : '';
?>
<li class="swiper-slide swiper-slide-sgnb">
<a href="<?php echo $link; ?>" class="sct_ct_view <?php echo $is_active; ?>">
<?php echo get_text($row['ca_name']); ?>
</a>
</li>
<?php
}
?>
</ul>
</ul>
<?php if (!$has_category): ?>
<?php echo latest('theme/notice_top', 'news', 1, 99); ?>
<?php endif; ?>
<script>
var swiper = new Swiper('.swiper-container-sgnb', {
slidesPerView: 'auto',
spaceBetween: 25,
touchRatio: 0,
breakpoints: {
1024: { slidesPerView: 'auto', touchRatio: 0, spaceBetween: 20 },
768: { slidesPerView: 'auto', touchRatio: 1, spaceBetween: 20 },
10: { slidesPerView: 'auto', touchRatio: 1, spaceBetween: 20 }
}
});
</script>
</li>
<?php endif; ?>
해당 부분 코드입니다.
- 이전글게시판문의2025.11.07
- 다음글상품구매 페이지에도 공지사항 대신 카테고리가 나오게 하고 싶습니다.2025.11.06
댓글목록

