영카트5 카테고리 출력 부분

영카트5 카테고리 출력 부분

QA

영카트5 카테고리 출력 부분

본문

영카트5  이윰빌더 시즌3 사용중인데요

 

카테고리 출력 부분에 KAPPA123 이라고 출력이 나와서 중간에 - 이걸 넣고싶은데

소스를 보니 네비게이션을 전체로 끌어와있는것 같더라구요. 방법이 없을까요?

 

{shop->get_navigation()} 이부분이 카테고리 경로 끌어오는 부분인데... 저중간 중간에 - 이표시를 어떻게 넣어야할까요...

이미지상 보이는 부분은 KAPPA234 로보이는데 실제 해당 분류는 KAPPA-2-3-4 경로 입니다.

 

990284832_1535097978.4042.png

 


<div class="clearfix">
        <div class="headline">
            <h5><strong><i class="fa fa-ellipsis-v"></i> <span>카테고리 -</span> {shop->get_navigation()}</strong></h5>
            <!--{? _is_admin}--><a href="{C.G5_ADMIN_URL}/shop_admin/itemform.php?w=u&it_id={_it_id}" class="btn-e btn-e-xs btn-e-purple rounded pull-right">상품 관리</a><!--{/}-->
        </div>
        <!--{* 상품분류 1 시작 *}-->
        <!--{? shop->listcategory()}-->
        <aside id="sct_ct_1" class="sct_ct">
            <strong><i class="fa fa-bars"></i> 관련 카테고리 :</strong>
            <!--{@ shop->listcategory()}-->
            <a href="{.href}">{.ca_name}({.cnt})</a>
            <!--{/}-->
        </aside>
        <!--{/}-->
        <!--{* 상품분류 1 끝 *}-->
    </div>

이 질문에 댓글 쓰기 :

답변 2

get_navigation()<---이 함수를 올려 보세요

그래야 방법을 알려드릴 수 있습니다

 

 

 


public function get_navigation() {
		global $g5, $ca_id;

		if ($ca_id) {
			$navigation = "";
			$len = strlen($ca_id) / 2;
			for ($i=1; $i<=$len; $i++) {
				$code = substr($ca_id,0,$i*2);

				$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$code' ";
				$row = sql_fetch($sql);

				$sct_here = '';
				if ($ca_id == $code) // 현재 분류와 일치하면
					$sct_here = 'sct_here';

				if ($i != $len) // 현재 위치의 마지막 단계가 아니라면
					$sct_bg = 'sct_bg';
				else $sct_bg = '';

				$navigation .= '<a href="./list.php?ca_id='.$code.'" class="'.$sct_here.' '.$sct_bg.'">'.$row['ca_name'].'</a>';
			}
		}
		else $navigation = $g5['title'];

		return $navigation;
	}

	public function get_navi($ca_id) {
		global $g5;

		if ($ca_id) {
			$navigation = "";
			$len = strlen($ca_id) / 2;
			for ($i=1; $i<=$len; $i++) {
				$code = substr($ca_id,0,$i*2);

				$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$code' ";
				$row = sql_fetch($sql);

				$sct_here = '';
				if ($ca_id == $code) // 현재 분류와 일치하면
					$sct_here = 'active';

				$navigation .= '<li class="'.$sct_here.'"><a href="./list.php?ca_id='.$code.'">'.$row['ca_name'].'</a></li>';
				if($i == $len) {
					$nav['title'] = $row['ca_name'];
				}
			}
		} else {
			$nav['title'] = $g5['title'];
			$navigation = $g5['title'];
		}
		$nav['path'] = $navigation;

		return $nav; 
	}

	public function listcategory($type='') {
		global $g5, $ca_id;
		switch($type) {
			default :
				$listcategory = '';
				$ca_id_len = strlen($ca_id);
				$len2 = $ca_id_len + 2;
				$len4 = $ca_id_len + 4;

				$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_order, ca_id ";
				$result = sql_query($sql);
				$i=0;
				while ($row=sql_fetch_array($result)) {

					$row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1'  ");

					$listcategory[$i]['href'] = "./list.php?ca_id=".$row['ca_id'];
					$listcategory[$i]['ca_name'] = $row['ca_name'];
					$listcategory[$i]['cnt'] = $row2['cnt'];
					$i++;
				}
				return $listcategory;
			break;
		}
	}

답변을 작성하시기 전에 로그인 해주세요.
전체 545
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT