영카트 여분필드 검색질문 드립니다.
본문
영카트 상품입력할때 wr_1하고 wr_2에 각각 입력할수 있게 만들었습니다.
상품 목록에서 검색을 붙여서 사용하려 하는데 잘 않되네요..
일반 게시판은 되는데 영카트 상품목록은 어떻게 처리해줘야할지요..?
아래처럼 넣어 봤는데 안되네요..
<form name="fsearch" method="get" role="form" class="form" style="margin-top:20px;">
</form>
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sop" value="and">
<div class="form-group">
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl" class="form-control input-sm">
<option value="wr_1"<?php echo get_selected($sfl, 'wr_1', true); ?>>선택1</option>
<option value="wr_2"<?php echo get_selected($sfl, 'wr_2'); ?>>선택2</option>
</select>
</div>
<div class="form-group">
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx" class="form-control input-sm" maxlength="20" placeholder="검색어">
</div>
<div class="btn-group btn-group-justified">
<div class="btn-group">
<button type="submit" class="btn btn-color"><i class="fa fa-check"></i></button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-black" data-dismiss="modal"><i class="fa fa-times"></i></button>
</div>
</div>
</form>
답변 2
영카트 상품테이블의 여분필드명은 wr_1, wr_2 가 아니라 it_1, it_2 ~~~ 입니다.
g5_shpo_item 테이블에 it_1 ~ it_10 까지 기본으로 있는데 wr_1 wr_2 필드를 추가했다는 말인가요?
그렇다고 하더라도 저렇게 폼을 만든다고 저절로 검색이 되지는 않습니다
list.php에서 검색 부분 코드를 만들어넣고 디비 추출 클래스 $list = new item_list 에도 코드를 넘겨주고
이런 동작들을 시켜야 검색이 작동합니다
위 검색폼의 action이 searh.php 라면 이 화일의 기존 코드를 보고 추가해 넣으세요