영카트 [YC4] 관련상품 등록할때 검색기능으로 사용할때
페이지 정보
본문
관련상품 등록에서 등록된 상품이 매우 많은 관계로 찾기가 어렵죠.
이것을 검색으로 제품을 찾는 방법으로 변경하고자 할때
1. adm / shop_admin/itemform.php 를
<script>
function search_relation(fld) {
if (fld.value) {
window.open('itemformrelation.php?it_id=<?=$it_id?>&ca_id='+fld.value, 'hiddenframe', '');
}
}
</script>
※ 상품 선택후 <FONT COLOR="#0E87F9">더블클릭하면 왼쪽에 추가됨</FONT><br>※ 한 번 클릭시 상품이미지/상품금액 출력<br>
<select onchange="search_relation(this)">
<option value=''>분류별 관련상품
<option value=''>----------------------
<?
$sql = " select ca_id, ca_name from $g4[yc4_category_table] where length(ca_id) = 2 order by ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
echo "<option value='$row[ca_id]'>$row[ca_name]\n";
}
?>
</select><br>
<select id='relation' size=8 style='width:250px; background-color:#F6F6F6;' onclick="relation_img(this.value, 'add_span')" ondblclick="relation_add(this);">
를 아래와 같이 수정
<script>
function search_relation(fld) {
if (fld.value) {
window.open('itemformrelation.php?it_id=<?=$it_id?>&ca_id='+fld.value, 'hiddenframe', '');
}
}
function search_relation2() {
var f = document.fitemform;
var ca_id = document.getElementById('relation_ca_id').value;
var q = document.getElementById('relation_q').value;
if (ca_id) {
window.open('itemformrelation.php?it_id=<?=$it_id?>&ca_id='+ca_id+'&q='+q, 'hiddenframe', '');
}
}
</script>
※ 상품 선택후 <FONT COLOR="#0E87F9">더블클릭하면 왼쪽에 추가됨</FONT><br>※ 한 번 클릭시 상품이미지/상품금액 출력<br>
<!-- <select onchange="search_relation(this)"> -->
<select id='relation_ca_id'>
<option value=''>분류별 관련상품
<option value=''>----------------------
<?
$sql = " select ca_id, ca_name from $g4[yc4_category_table] where length(ca_id) = 2 order by ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
echo "<option value='$row[ca_id]'>$row[ca_name]\n";
}
?>
</select><br>
<input type='text' id='relation_q' size='10' class='ed' /> <input type='button' value='검색' onclick="search_relation2()" /><br>
<select id='relation' size=8 style='width:250px; background-color:#F6F6F6;' onclick="relation_img(this.value, 'add_span')" ondblclick="relation_add(this);">
2. adm / shop_admin/itemformrelation.php 를
$sql = " select ca_id, it_id, it_name, it_amount
from $g4[yc4_item_table]
where ca_id like '$ca_id%'
and it_id <> '$it_id'
order by ca_id, it_name ";
아래와 같이 수정
$sql = " select ca_id, it_id, it_name, it_amount
from $g4[yc4_item_table]
where ca_id like '$ca_id%'
and it_id <> '$it_id' ";
if ($q)
$sql .= " and it_name like '%$q%' ";
$sql .= " order by ca_id, it_name ";
관련자료
http://sir.co.kr/bbs/board.php?bo_table=yc4_qa&wr_id=24979
이것을 검색으로 제품을 찾는 방법으로 변경하고자 할때
1. adm / shop_admin/itemform.php 를
<script>
function search_relation(fld) {
if (fld.value) {
window.open('itemformrelation.php?it_id=<?=$it_id?>&ca_id='+fld.value, 'hiddenframe', '');
}
}
</script>
※ 상품 선택후 <FONT COLOR="#0E87F9">더블클릭하면 왼쪽에 추가됨</FONT><br>※ 한 번 클릭시 상품이미지/상품금액 출력<br>
<select onchange="search_relation(this)">
<option value=''>분류별 관련상품
<option value=''>----------------------
<?
$sql = " select ca_id, ca_name from $g4[yc4_category_table] where length(ca_id) = 2 order by ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
echo "<option value='$row[ca_id]'>$row[ca_name]\n";
}
?>
</select><br>
<select id='relation' size=8 style='width:250px; background-color:#F6F6F6;' onclick="relation_img(this.value, 'add_span')" ondblclick="relation_add(this);">
를 아래와 같이 수정
<script>
function search_relation(fld) {
if (fld.value) {
window.open('itemformrelation.php?it_id=<?=$it_id?>&ca_id='+fld.value, 'hiddenframe', '');
}
}
function search_relation2() {
var f = document.fitemform;
var ca_id = document.getElementById('relation_ca_id').value;
var q = document.getElementById('relation_q').value;
if (ca_id) {
window.open('itemformrelation.php?it_id=<?=$it_id?>&ca_id='+ca_id+'&q='+q, 'hiddenframe', '');
}
}
</script>
※ 상품 선택후 <FONT COLOR="#0E87F9">더블클릭하면 왼쪽에 추가됨</FONT><br>※ 한 번 클릭시 상품이미지/상품금액 출력<br>
<!-- <select onchange="search_relation(this)"> -->
<select id='relation_ca_id'>
<option value=''>분류별 관련상품
<option value=''>----------------------
<?
$sql = " select ca_id, ca_name from $g4[yc4_category_table] where length(ca_id) = 2 order by ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
echo "<option value='$row[ca_id]'>$row[ca_name]\n";
}
?>
</select><br>
<input type='text' id='relation_q' size='10' class='ed' /> <input type='button' value='검색' onclick="search_relation2()" /><br>
<select id='relation' size=8 style='width:250px; background-color:#F6F6F6;' onclick="relation_img(this.value, 'add_span')" ondblclick="relation_add(this);">
2. adm / shop_admin/itemformrelation.php 를
$sql = " select ca_id, it_id, it_name, it_amount
from $g4[yc4_item_table]
where ca_id like '$ca_id%'
and it_id <> '$it_id'
order by ca_id, it_name ";
아래와 같이 수정
$sql = " select ca_id, it_id, it_name, it_amount
from $g4[yc4_item_table]
where ca_id like '$ca_id%'
and it_id <> '$it_id' ";
if ($q)
$sql .= " and it_name like '%$q%' ";
$sql .= " order by ca_id, it_name ";
관련자료
http://sir.co.kr/bbs/board.php?bo_table=yc4_qa&wr_id=24979
댓글목록
등록된 댓글이 없습니다.