테스트 사이트 - 개발 중인 베타 버전입니다

영카트 상품등록 중에 상품분류 추가요~ 채택완료

민이엄마 10년 전 조회 3,653

영카트 상품등록할때요.. 상품분류가3개까지 할수 있게 세팅되어있는데요..이거 늘릴수 있나요?

 

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
10년 전

DB필드에 ca_id4 ... ca_id5

 

이런식으로 추가하시고 db에 입력하신 후 

 

shop.lib.php

아래와 같이 하신 후에

    function set_category($ca_id, $level=1) {

        if ($level == 2) {

            $this->ca_id2 = $ca_id;

        } else if ($level == 3) {

            $this->ca_id3 = $ca_id;

        } else if ($level == 4) {

            $this->ca_id4 = $ca_id;

        } else if ($level == 5) {

            $this->ca_id5 = $ca_id;

        } else if ($level == 6) {

            $this->ca_id6 = $ca_id;

} else {

            $this->ca_id = $ca_id;

        }

    }

 

 

run()함수에서

 

// add ca_id4,5,6

            if ($this->ca_id || $this->ca_id2 || $this->ca_id3 || $this->ca_id4 || $this->ca_id5 || $this->ca_id6) {

                $where_ca_id = array();

                if ($this->ca_id) {

                    $where_ca_id[] = " ca_id like '{$this->ca_id}%' ";

                }

                if ($this->ca_id2) {

                    $where_ca_id[] = " ca_id2 like '{$this->ca_id2}%' ";

                }

                if ($this->ca_id3) {

                    $where_ca_id[] = " ca_id3 like '{$this->ca_id3}%' ";

                }

                if ($this->ca_id4) {

                    $where_ca_id[] = " ca_id4 like '{$this->ca_id4}%' ";

                }

                if ($this->ca_id5) {

                    $where_ca_id[] = " ca_id5 like '{$this->ca_id5}%' ";

                }

                if ($this->ca_id6) {

                    $where_ca_id[] = " ca_id6 like '{$this->ca_id6}%' ";

                }

$where[] = " ( " . implode(" or ", $where_ca_id) . " ) ";

            }

 

 

 

카테고리 출력하는 부분에는 아래와 같이 추가하시면 작동합니다.

$list->set_category('50', 1);

$list->set_category('50', 2);

$list->set_category('50', 3);

$list->set_category('50', 4);

$list->set_category('50', 5);

$list->set_category('50', 6);

 

 

구현해 놓은게 있는데 설명하려니 좀 복잡하네요 ㅠㅠ


로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

10년 전

제가 디자이너인데 프로그램을 몰라서요...ㅜㅜ

DB필드가 뭔지요? 어디있나요? 그리고 db에 입력하라고 하시는건 어디에 하라는건지..ㅜㅜ

shop.lib.php 이파일은 뭔지..

좀더 자세히 설명해주실수 있을까요? 부탁드려요

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인