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

선택옵션 0원 으로 나오는거 금액이 없을때 안나오게 하기

· 11년 전 · 8989 · 10
선택옵션 0원 으로 나오는거 금액이 없을때 안나오게 하기

/js/shop.js 에 아래처럼 소스변경 add_sel_option() 함수내용 변경 - 360번째줄
[code]
opt += "<li class=\""+li_class+"\">";
opt += "<input type=\"hidden\" name=\"io_type["+item_code+"][]\" value=\""+type+"\">";
opt += "<input type=\"hidden\" name=\"io_id["+item_code+"][]\" value=\""+id+"\">";
opt += "<input type=\"hidden\" name=\"io_value["+item_code+"][]\" value=\""+option+"\">";
opt += "<input type=\"hidden\" class=\"io_price\" value=\""+price+"\">";
opt += "<input type=\"hidden\" class=\"io_stock\" value=\""+stock+"\">";
opt += "<span class=\"sit_opt_subj\">"+option+"</span>";
opt += "<span class=\"sit_opt_prc\">"+opt_prc+"</span>";
opt += "<div><input type=\"text\" name=\"ct_qty["+item_code+"][]\" value=\"1\" class=\"frm_input\" size=\"5\">";
opt += "<button type=\"button\" class=\"sit_qty_plus btn_frmline\">증가</button>";
opt += "<button type=\"button\" class=\"sit_qty_minus btn_frmline\">감소</button>";
opt += "<button type=\"button\" class=\"sit_opt_del btn_frmline\">삭제</button></div>";
opt += "</li>";
[/code]
아래같이 변경↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

[code]
opt += "<li class=\""+li_class+"\">";
opt += "<input type=\"hidden\" name=\"io_type["+item_code+"][]\" value=\""+type+"\">";
opt += "<input type=\"hidden\" name=\"io_id["+item_code+"][]\" value=\""+id+"\">";
opt += "<input type=\"hidden\" name=\"io_value["+item_code+"][]\" value=\""+option+"\">";
opt += "<input type=\"hidden\" class=\"io_price\" value=\""+price+"\">";
opt += "<input type=\"hidden\" class=\"io_stock\" value=\""+stock+"\">";
opt += "<span class=\"sit_opt_subj\">"+option+"</span>";
if(price > 0){
opt += "<span class=\"sit_opt_prc\">"+opt_prc+"</span>";
}else{
opt += "<span class=\"sit_opt_prc\" style='display:none;'>"+opt_prc+"</span>";
}
opt += "<div><input type=\"text\" name=\"ct_qty["+item_code+"][]\" value=\"1\" class=\"frm_input\" size=\"5\">";
opt += "<button type=\"button\" class=\"sit_qty_plus btn_frmline\">증가</button>";
opt += "<button type=\"button\" class=\"sit_qty_minus btn_frmline\">감소</button>";
opt += "<button type=\"button\" class=\"sit_opt_del btn_frmline\">삭제</button></div>";
opt += "</li>";
[/code]

/lib/shop.lib.php에 아래처럼 소스변경 get_item_options 함수내용 변경 - 996번째줄 변경
[code]
$select .= '<option value="'.$row['io_id'].','.$row['io_price'].','.$row['io_stock_qty'].'">'.$row['io_id'].$price.$soldout.'</option>'.PHP_EOL;
[/code]
아래같이 변경↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
[code]
if($price > 0){
$select .= '<option value="'.$row['io_id'].','.$row['io_price'].','.$row['io_stock_qty'].'">'.$row['io_id'].$price.$soldout.'</option>'.PHP_EOL;
}else{
$select .= '<option value="'.$row['io_id'].','.$row['io_price'].','.$row['io_stock_qty'].'">'.$row['io_id'].$soldout.'</option>'.PHP_EOL;
}
[/code]





/lib/shop.lib.php에 아래처럼 소스변경 print_item_options 함수내용 변경 -대략 1093?1099?번째줄 변경

[code]
$str .= '<li>'.$row['ct_option'].' '.$row['ct_qty'].'개 ('.$price_plus.display_price($row['io_price']).')</li>'.PHP_EOL;
[/code]
아래같이 변경↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
[code]
if($row['io_price'] > 0){
$str .= '<li>'.$row['ct_option'].' '.$row['ct_qty'].'개 ('.$price_plus.display_price($row['io_price']).')</li>'.PHP_EOL;
}else{
$str .= '<li>'.$row['ct_option'].' '.$row['ct_qty'].'개 </li>'.PHP_EOL;
}
[/code]

/shop/itemoption.php에 아래처럼 소스변경 42번째줄 부터
[code]
if($row['io_price'] >= 0)
$price = '&nbsp;&nbsp;+ '.number_format($row['io_price']).'원';
else
$price = '&nbsp;&nbsp; '.number_format($row['io_price']).'원';
[/code]
아래같이 변경↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
[code]
if($row['io_price'] >= 0){
if($row['io_price'] == 0){
$price = '&nbsp;&nbsp;';
}else{
$price = '&nbsp;&nbsp;+ '.number_format($row['io_price']).'원';
}

}else{
$price = '&nbsp;&nbsp; '.number_format($row['io_price']).'원';
}

[/code]

댓글 작성

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

로그인하기

댓글 10개

좋은 팁 감사합니다.
적용 후 선택 옵션의 수량을 조정하면 '올바른 방법으로 이용해 주십시오. 경고창이 뜹니다.
저만 그런 것인지 모르겠습니다만, [증가][감소] 글자 대신 [+][-] 기호로 나타나면 오류가 발생하는 것 같습니다.
11년 전
+ -바꾸는건 또 js파일에두 바꿔야 할게 있습니다
그것두 보구 팁자료실에 업데이트 할게요
좋은 팁입니다. 헌데 2개의 옵션이 있는 경우에는 적용이 되지 않는 것 같습니다.
의류의 경우 색상을 1차옵션, 2차에 사이즈를 넣는다고 치면 1차에서는 뜨지 않지만 2차옵션에서는 발생합니다.
/shop/itemoption.php 44줄에
else if($row['io_price'] == 0)
$price = '';

삽입하세요.
오래된 문의였었는데 친절하신 답변 감사합니다!!
10년 전
감사합니다.
10년 전
좋은팁 정말 감사합니다^^
10년 전
좋은팁감사합니다^^
좋은팁 감사합니다 덕분에 잘 써먹었어요! 추천하고싶은데 오래된 글이라 추천이 안되네요 ㅠㅠ
영카트 옵션

게시글 목록

번호 제목
246
245
241
221
219
218
215
213
210
205
201
199
198
193
192
191
184
183
173
171
170
169
166
165
158
157
153
151
150
137