2026, 새로운 도약을 시작합니다.

it_brand 로 해당 브랜드 제품만 보기 채택완료

it_brand에 

1, 2, 3 ,4, 5라는 브랜드가 있을 때 

브랜드를 sql 쿼리로 카테고리처럼 불러 오고 

전체 제품 리스트를 불러오는거 까지는 했습니다.

카테고리에서 1 클릭했을 때 1이라는 브랜드만 보고 싶은데

a href="주소.php?" 뒤에

&it_brand=1 이나  &sfl=it_brand&stx=1  이라고 하니 되지 않네요.

답변 2개

채택된 답변
+20 포인트
Copy


shop.lib.php

.

.

.

 // 기본으로 보여지는 필드들

    protected $view_it_id    = false;       // 상품코드

    protected $view_it_img   = true;        // 상품이미지

    protected $view_it_name  = true;        // 상품명

    protected $view_it_basic = true;        // 기본설명

    protected $view_it_price = true;        // 판매가격

    protected $view_it_cust_price = false;  // 소비자가

    protected $view_it_icon = false;        // 아이콘

    protected $view_sns = false;            // SNS

    protected $view_star = false;           // 별점

 

    protected $it_brand = ''; // 추가

.

.

.

 // 외부에서 쿼리문을 넘겨줄 경우에 담아둡니다.

    function set_query($query) {

        $this->query = $query;

    }

하단

    function set_brand($brand) {

        $this->brand = $brand;

    }

추가

.

.

.

if ($this->type) {

                $where[] = " it_type{$this->type} = '1' ";

            }

하단

if ($this->it_brand) {

           $where[] = " it_brand = '{$this->it_brand}' ";

}

추가

list.php

.

.

$list->set_view('it_icon', true);

$list->set_view('sns', true);

쯔음 

$list->set_brand($it_brand);

추가

 

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

답변에 대한 댓글 1개

감사합니다. 소스 활용해서 잘 해결하였습니다

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

it_brand 인덱스 추가도 고려해 보세요

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

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

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

로그인
🐛 버그신고