장바구니 옵션 출력 부분 수정 중
This commit is contained in:
@ -676,47 +676,24 @@ function get_item_supply($it_id, $subject)
|
|||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 인수는 $it_id, $it_opt1, ..., $it_opt6 까지 넘어옴
|
function print_item_options($it_id, $uq_id)
|
||||||
function print_item_options()
|
|
||||||
{
|
{
|
||||||
global $g4;
|
global $g4;
|
||||||
|
|
||||||
$it_id = func_get_arg(0);
|
$sql = " select ct_option from {$g4['shop_cart_table']} where it_id = '$it_id' and uq_id = '$uq_id' order by ct_num asc ";
|
||||||
$sql = " select it_opt1_subject,
|
$result = sql_query($sql);
|
||||||
it_opt2_subject,
|
|
||||||
it_opt3_subject,
|
|
||||||
it_opt4_subject,
|
|
||||||
it_opt5_subject,
|
|
||||||
it_opt6_subject
|
|
||||||
from {$g4['shop_item_table']}
|
|
||||||
where it_id = '$it_id' ";
|
|
||||||
$it = sql_fetch($sql);
|
|
||||||
|
|
||||||
$it_name = $str_split = '';
|
$str = '';
|
||||||
for ($i=1; $i<=6; $i++)
|
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||||
{
|
if($i == 0)
|
||||||
if ($i == 1) $str_split .= '<span class="sound_only">상품옵션 </span>';
|
$str .= '<ul>'.PHP_EOL;
|
||||||
$it_opt = trim(func_get_arg($i));
|
$str .= '<li>'.$row['ct_option'].'</li>'.PHP_EOL;
|
||||||
// 상품옵션에서 0은 제외되는 현상을 수정
|
|
||||||
if ($it_opt==null) continue;
|
|
||||||
|
|
||||||
$it_name .= $str_split;
|
|
||||||
$it_opt_subject = $it['it_opt'.$i.'_subject'];
|
|
||||||
$opt = explode( ';', $it_opt );
|
|
||||||
$it_name .= $it_opt_subject.' = '.$opt[0];
|
|
||||||
|
|
||||||
if ($opt[1] != 0)
|
|
||||||
{
|
|
||||||
$it_name .= ' (';
|
|
||||||
//if (ereg("[+]", $opt[1]) == true)
|
|
||||||
if (preg_match("/[+]/", $opt[1]) == true)
|
|
||||||
$it_name .= '+';
|
|
||||||
$it_name .= display_price($opt[1]).')';
|
|
||||||
}
|
|
||||||
$str_split = '<br>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $it_name;
|
if($i > 0)
|
||||||
|
$str .= '</ul>';
|
||||||
|
|
||||||
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
function it_name_icon($it, $it_name="", $url=1)
|
function it_name_icon($it, $it_name="", $url=1)
|
||||||
|
|||||||
@ -43,23 +43,16 @@ $goods_count = -1;
|
|||||||
|
|
||||||
// $s_uq_id 로 현재 장바구니 자료 쿼리
|
// $s_uq_id 로 현재 장바구니 자료 쿼리
|
||||||
$sql = " select a.ct_id,
|
$sql = " select a.ct_id,
|
||||||
|
a.it_id,
|
||||||
a.it_name,
|
a.it_name,
|
||||||
a.it_opt1,
|
|
||||||
a.it_opt2,
|
|
||||||
a.it_opt3,
|
|
||||||
a.it_opt4,
|
|
||||||
a.it_opt5,
|
|
||||||
a.it_opt6,
|
|
||||||
a.ct_price,
|
a.ct_price,
|
||||||
a.ct_point,
|
a.ct_point,
|
||||||
a.ct_qty,
|
a.ct_qty,
|
||||||
a.ct_status,
|
a.ct_status,
|
||||||
b.it_id,
|
|
||||||
b.ca_id
|
b.ca_id
|
||||||
from {$g4['shop_cart_table']} a,
|
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
|
||||||
{$g4['shop_item_table']} b
|
|
||||||
where a.uq_id = '$s_uq_id'
|
where a.uq_id = '$s_uq_id'
|
||||||
and a.it_id = b.it_id
|
and a.ct_num = '0'
|
||||||
order by a.ct_id ";
|
order by a.ct_id ";
|
||||||
$result = sql_query($sql);
|
$result = sql_query($sql);
|
||||||
|
|
||||||
@ -67,6 +60,13 @@ $good_info = '';
|
|||||||
|
|
||||||
for ($i=0; $row=mysql_fetch_array($result); $i++)
|
for ($i=0; $row=mysql_fetch_array($result); $i++)
|
||||||
{
|
{
|
||||||
|
// 합계금액 계산
|
||||||
|
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
|
||||||
|
SUM(ct_point * ct_qty) as point
|
||||||
|
from {$g4['shop_cart_table']}
|
||||||
|
where it_id = '{$row['it_id']}' ";
|
||||||
|
$sum = sql_fetch($sql);
|
||||||
|
|
||||||
if (!$goods)
|
if (!$goods)
|
||||||
{
|
{
|
||||||
//$goods = addslashes($row[it_name]);
|
//$goods = addslashes($row[it_name]);
|
||||||
@ -102,12 +102,16 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
|
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
|
||||||
if ($row['it_opt1'] || $row['it_opt2'] || $row['it_opt3'] || $row['it_opt4'] || $row['it_opt5'] || $row['it_opt6']) { // 상품에 옵션이 있다면
|
$it_options = print_item_options($row['it_id'], $s_uq_id);
|
||||||
$it_name .= '<div class="sod_bsk_itopt">'.print_item_options($row['it_id'], $row['it_opt1'], $row['it_opt2'], $row['it_opt3'], $row['it_opt4'], $row['it_opt5'], $row['it_opt6']).'</div>';
|
if($it_options) {
|
||||||
|
$mod_options = '';
|
||||||
|
if($s_page == 'cart.php')
|
||||||
|
$mod_options = '<button type="button" class="mod_options">선택사항수정</button>';
|
||||||
|
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.$mod_options.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$point = $row['ct_point'] * $row['ct_qty'];
|
$point = $sum['point'];
|
||||||
$sell_amount = $row['ct_price'] * $row['ct_qty'];
|
$sell_amount = $sum['price'];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@ -237,6 +241,11 @@ if ($s_page == 'cart.php') {
|
|||||||
if ($i != 0) {
|
if ($i != 0) {
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
|
$(function() {
|
||||||
|
$(".mod_options").click(function() {
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
function form_check(act) {
|
function form_check(act) {
|
||||||
var f = document.frmcartlist;
|
var f = document.frmcartlist;
|
||||||
var cnt = f.records.value;
|
var cnt = f.records.value;
|
||||||
|
|||||||
Reference in New Issue
Block a user