#224 선택주문 기능 추가
This commit is contained in:
@ -274,4 +274,12 @@ if(!$result) {
|
||||
ADD `od_id` BIGINT(20) UNSIGNED NOT NULL AFTER `cp_maximum`,
|
||||
ADD `cp_used_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `cp_used` ", false);
|
||||
}
|
||||
|
||||
// 장바구니 선택필드추가
|
||||
$sql = " select ct_select from {$g4['shop_cart_table']} limit 1 ";
|
||||
$result = sql_query($sql, false);
|
||||
if(!$result) {
|
||||
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
|
||||
ADD `ct_select` TINYINT(4) NOT NULL DEFAULT '0' AFTER `ct_direct` ", true);
|
||||
}
|
||||
?>
|
||||
@ -75,7 +75,8 @@ CREATE TABLE IF NOT EXISTS `shop_cart` (
|
||||
`ct_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ct_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
`ct_send_cost` varchar(255) NOT NULL,
|
||||
`ct_direct` tinyint(4) NOT NULL,
|
||||
`ct_direct` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`ct_select` tinyint(4) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ct_id`),
|
||||
KEY `uq_id` (`uq_id`),
|
||||
KEY `ct_num` (`ct_num`)
|
||||
|
||||
@ -3,14 +3,13 @@ include_once('./_common.php');
|
||||
|
||||
$g4['title'] = '장바구니';
|
||||
include_once(G4_MSHOP_PATH.'/_head.php');
|
||||
$s_uq_id = get_session('ss_uq_id');
|
||||
?>
|
||||
|
||||
<script src="<?php echo G4_JS_URL; ?>/shop.js"></script>
|
||||
|
||||
<div id="sod_bsk">
|
||||
|
||||
<form name="frmcartlist" id="sod_bsk_list" method="post">
|
||||
<form name="frmcartlist" id="sod_bsk_list" method="post" action="<?php echo $cart_action_url; ?>">
|
||||
<table class="basic_tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -20,7 +19,7 @@ $s_uq_id = get_session('ss_uq_id');
|
||||
<th scope="col">판매가</th>
|
||||
<th scope="col">소계</th>
|
||||
<th scope="col">포인트</th>
|
||||
<th scope="col"><input type="checkbox" name="ct_all" value="1"></th>
|
||||
<th scope="col"><input type="checkbox" name="ct_all" value="1" checked="checked"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -91,7 +90,7 @@ $s_uq_id = get_session('ss_uq_id');
|
||||
<td class="td_bignum"><?php echo number_format($row['ct_price']); ?></td>
|
||||
<td class="td_bignum"><?php echo number_format($sell_amount); ?></td>
|
||||
<td class="td_num"><?php echo number_format($sum['point']); ?></td>
|
||||
<td class="td_smallmng"><input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1"></td>
|
||||
<td class="td_smallmng"><input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1" checked="checked"></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
@ -158,9 +157,9 @@ $s_uq_id = get_session('ss_uq_id');
|
||||
<input type="hidden" name="records" value="<?php echo $i; ?>">
|
||||
<p>장바구니의 상품을 주문하시려면 <strong>주문하기</strong>를 클릭하세요. <strong>비우기</strong>는 장바구니의 상품을 모두 비웁니다.</p>
|
||||
<a href="<?php echo G4_SHOP_URL; ?>/list.php?ca_id=<?php echo $continue_ca_id; ?>" class="btn01">쇼핑 계속하기</a>
|
||||
<a href="javascript:form_check('buy');" class="btn02">주문하기</a>
|
||||
<a href="javascript:form_check('seldelete');" class="btn01">선택삭제</a>
|
||||
<a href="javascript:form_check('alldelete');" class="btn01">비우기</a>
|
||||
<button type="button" onclick="return form_check('buy');" class="btn02">주문하기</button>
|
||||
<button type="button" onclick="return form_check('seldelete');" class="btn01">선택삭제</button>
|
||||
<button type="button" onclick="return form_check('alldelete');" class="btn01">비우기</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@ -221,21 +220,11 @@ function form_check(act) {
|
||||
if (act == "buy")
|
||||
{
|
||||
f.act.value = act;
|
||||
|
||||
<?php
|
||||
if (get_session('ss_mb_id')) // 회원인 경우
|
||||
{
|
||||
echo "f.action = './orderform.php';";
|
||||
echo "f.submit();";
|
||||
}
|
||||
else
|
||||
echo "document.location.href = '".G4_BBS_URL."/login.php?url=".urlencode(G4_SHOP_URL."/orderform.php")."';";
|
||||
?>
|
||||
f.submit();
|
||||
}
|
||||
else if (act == "alldelete")
|
||||
{
|
||||
f.act.value = act;
|
||||
f.action = "./cartupdate.php";
|
||||
f.submit();
|
||||
}
|
||||
else if (act == "seldelete")
|
||||
@ -246,7 +235,6 @@ function form_check(act) {
|
||||
}
|
||||
|
||||
f.act.value = act;
|
||||
f.action = "./cartupdate.php";
|
||||
f.submit();
|
||||
}
|
||||
|
||||
|
||||
@ -68,6 +68,7 @@ ob_start();
|
||||
b.ca_id
|
||||
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
|
||||
where a.uq_id = '$s_uq_id'
|
||||
and a.ct_select = '1'
|
||||
and a.ct_num = '0' ";
|
||||
if($default['de_cart_keep_term']) {
|
||||
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
|
||||
@ -167,7 +168,8 @@ ob_start();
|
||||
} // for 끝
|
||||
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="'.$colspan.'" class="empty_table">장바구니에 담긴 상품이 없습니다.</td></tr>';
|
||||
//echo '<tr><td colspan="'.$colspan.'" class="empty_table">장바구니에 담긴 상품이 없습니다.</td></tr>';
|
||||
alert('장바구니가 비어 있습니다.', G4_SHOP_URL.'/cart.php');
|
||||
} else {
|
||||
// 배송비 계산
|
||||
if ($default['de_send_cost_case'] == '없음')
|
||||
|
||||
@ -37,7 +37,8 @@ $sql = " select it_id,
|
||||
io_type,
|
||||
ct_option
|
||||
from {$g4['shop_cart_table']}
|
||||
where uq_id = '$tmp_uq_id' ";
|
||||
where uq_id = '$tmp_uq_id'
|
||||
and ct_select = '1' ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
@ -52,6 +53,9 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
$error .= "{$row['ct_option']} 의 재고수량이 부족합니다. 현재고수량 : $it_stock_qty 개\\n\\n";
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
alert('장바구니가 비어 있습니다.\\n\\n이미 주문하셨거나 장바구니에 담긴 상품이 없는 경우입니다.', G4_SHOP_URL.'/cart.php');
|
||||
|
||||
if ($error != "")
|
||||
{
|
||||
$error .= "다른 고객님께서 {$od_name}님 보다 먼저 주문하신 경우입니다. 불편을 끼쳐 죄송합니다.";
|
||||
@ -65,7 +69,7 @@ $i_temp_point = (int)$_POST['od_temp_point'];
|
||||
|
||||
// 주문금액이 상이함
|
||||
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_amount
|
||||
from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' ";
|
||||
from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and ct_select = '1' ";
|
||||
$row = sql_fetch($sql);
|
||||
$tot_ct_amount = $row['od_amount'];
|
||||
|
||||
@ -112,7 +116,8 @@ if($is_member) {
|
||||
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
|
||||
from {$g4['shop_cart_table']}
|
||||
where uq_id = '$tmp_uq_id'
|
||||
and it_id = '$it_id' ";
|
||||
and it_id = '$it_id'
|
||||
and ct_select = '1' ";
|
||||
$ct = sql_fetch($sql);
|
||||
$item_price = $ct['sum_price'];
|
||||
|
||||
@ -372,10 +377,13 @@ else
|
||||
// 주문번호를 얻는다.
|
||||
$od_id = get_session('ss_order_uniqid');
|
||||
|
||||
// 주문상품의 uq_id 변경을 위한 uq_id를 얻는다.
|
||||
$uq_id = get_uniqid();
|
||||
|
||||
// 주문서에 입력
|
||||
$sql = " insert {$g4['shop_order_table']}
|
||||
set od_id = '$od_id',
|
||||
uq_id = '$tmp_uq_id',
|
||||
uq_id = '$uq_id',
|
||||
mb_id = '{$member['mb_id']}',
|
||||
od_pwd = '$od_pwd',
|
||||
od_name = '$od_name',
|
||||
@ -438,9 +446,11 @@ if (($od_receipt_card > 0 || $od_receipt_hp > 0) && $default['de_card_point'] ==
|
||||
$sql_card_point = " , ct_point = '0' ";
|
||||
}
|
||||
$sql = "update {$g4['shop_cart_table']}
|
||||
set ct_status = '주문'
|
||||
set uq_id = '$uq_id',
|
||||
ct_status = '주문'
|
||||
$sql_card_point
|
||||
where uq_id = '$tmp_uq_id' ";
|
||||
where uq_id = '$tmp_uq_id'
|
||||
and ct_select = '1' ";
|
||||
$result = sql_query($sql, false);
|
||||
|
||||
// 주문정보 입력 오류시 kcp 결제 취소
|
||||
@ -453,7 +463,7 @@ if(!$result) {
|
||||
echo "<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['PHP_SELF']}";
|
||||
|
||||
// 주문삭제
|
||||
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$tmp_uq_id' ");
|
||||
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -488,8 +498,9 @@ if($is_member) {
|
||||
$cp_amt = (int)$arr_it_cp_amt[$cp_it_id];
|
||||
$sql = " update {$g4['shop_cart_table']}
|
||||
set cp_amount = '$cp_amt'
|
||||
where uq_id = '$tmp_uq_id'
|
||||
where uq_id = '$uq_id'
|
||||
and it_id = '$cp_it_id'
|
||||
and ct_select = '1'
|
||||
and ct_num = '0' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
@ -562,20 +573,14 @@ if($default['de_sms_use'] && ($default['de_sms_use2'] || $default['de_sms_use3']
|
||||
|
||||
|
||||
// orderview 에서 사용하기 위해 tmp에 넣고
|
||||
set_session('ss_temp_uq_id', $tmp_uq_id);
|
||||
set_session('ss_temp_uq_id', $uq_id);
|
||||
|
||||
// 주문번호제거
|
||||
set_session('ss_order_uniqid', '');
|
||||
|
||||
// ss_uq_id 기존자료 세션에서 제거
|
||||
// 기존자료 세션에서 제거
|
||||
if (get_session('ss_direct'))
|
||||
set_session('ss_uq_direct', '');
|
||||
else
|
||||
set_session('ss_uq_id', '');
|
||||
|
||||
// 비회원장바구니 쿠키 초기화
|
||||
if(get_cookie('ck_guest_cart_uqid'))
|
||||
set_cookie('ck_guest_cart_uqid', '', 0);
|
||||
|
||||
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uq_id='.$tmp_uq_id);
|
||||
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uq_id='.$uq_id);
|
||||
?>
|
||||
|
||||
@ -22,6 +22,13 @@ if($is_member && $sw_direct != 1) {
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
$s_uq_id = get_session('ss_uq_id');
|
||||
// 선택필드 초기화
|
||||
$sql = " update {$g4['shop_cart_table']} set ct_select = '0' where uq_id = '$s_uq_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
$cart_action_url = G4_SHOP_URL.'/cartupdate.php';
|
||||
|
||||
if (G4_IS_MOBILE) {
|
||||
include_once(G4_MSHOP_PATH.'/cart.php');
|
||||
return;
|
||||
@ -29,14 +36,13 @@ if (G4_IS_MOBILE) {
|
||||
|
||||
$g4['title'] = '장바구니';
|
||||
include_once('./_head.php');
|
||||
$s_uq_id = get_session('ss_uq_id');
|
||||
?>
|
||||
|
||||
<script src="<?php echo G4_JS_URL; ?>/shop.js"></script>
|
||||
|
||||
<div id="sod_bsk">
|
||||
|
||||
<form name="frmcartlist" id="sod_bsk_list" method="post">
|
||||
<form name="frmcartlist" id="sod_bsk_list" method="post" action="<?php echo $cart_action_url; ?>">
|
||||
<table class="basic_tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -46,7 +52,7 @@ $s_uq_id = get_session('ss_uq_id');
|
||||
<th scope="col">판매가</th>
|
||||
<th scope="col">소계</th>
|
||||
<th scope="col">포인트</th>
|
||||
<th scope="col"><input type="checkbox" name="ct_all" value="1"></th>
|
||||
<th scope="col"><input type="checkbox" name="ct_all" value="1" checked="checked"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -122,7 +128,7 @@ $s_uq_id = get_session('ss_uq_id');
|
||||
<td class="td_bignum"><?php echo number_format($row['ct_price']); ?></td>
|
||||
<td class="td_bignum"><span id="sell_amount_<?php echo $i; ?>"><?php echo number_format($sell_amount); ?></span></td>
|
||||
<td class="td_bignum"><?php echo number_format($point); ?></td>
|
||||
<td class="td_smallmng"><input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1"></td>
|
||||
<td class="td_smallmng"><input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1" checked="checked"></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
@ -196,9 +202,9 @@ $s_uq_id = get_session('ss_uq_id');
|
||||
<input type="hidden" name="act" value="">
|
||||
<p>장바구니의 상품을 주문하시려면 <strong>주문하기</strong>를 클릭하세요. <strong>비우기</strong>는 장바구니의 상품을 모두 비웁니다.</p>
|
||||
<a href="<?php echo G4_SHOP_URL; ?>/list.php?ca_id=<?php echo $continue_ca_id; ?>" class="btn01">쇼핑 계속하기</a>
|
||||
<a href="javascript:form_check('buy');" class="btn02">주문하기</a>
|
||||
<a href="javascript:form_check('seldelete');" class="btn01">선택삭제</a>
|
||||
<a href="javascript:form_check('alldelete');" class="btn01">비우기</a>
|
||||
<button type="button" onclick="return form_check('buy');" class="btn02">주문하기</button>
|
||||
<button type="button" onclick="return form_check('seldelete');" class="btn01">선택삭제</button>
|
||||
<button type="button" onclick="return form_check('alldelete');" class="btn01">비우기</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@ -258,22 +264,17 @@ function form_check(act) {
|
||||
|
||||
if (act == "buy")
|
||||
{
|
||||
f.act.value = act;
|
||||
|
||||
<?php
|
||||
if (get_session('ss_mb_id')) // 회원인 경우
|
||||
{
|
||||
echo "f.action = './orderform.php';";
|
||||
echo "f.submit();";
|
||||
if($("input[name^=ct_chk]:checked").size() < 1) {
|
||||
alert("주문하실 상품을 하나이상 선택해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
echo "document.location.href = '".G4_BBS_URL."/login.php?url=".urlencode(G4_SHOP_URL."/orderform.php")."';";
|
||||
?>
|
||||
|
||||
f.act.value = act;
|
||||
f.submit();
|
||||
}
|
||||
else if (act == "alldelete")
|
||||
{
|
||||
f.act.value = act;
|
||||
f.action = "./cartupdate.php";
|
||||
f.submit();
|
||||
}
|
||||
else if (act == "seldelete")
|
||||
@ -284,7 +285,6 @@ function form_check(act) {
|
||||
}
|
||||
|
||||
f.act.value = act;
|
||||
f.action = "./cartupdate.php";
|
||||
f.submit();
|
||||
}
|
||||
|
||||
|
||||
@ -22,8 +22,29 @@ if ($member['mb_level'] < $default['de_level_sell'])
|
||||
alert('상품을 구입할 수 있는 권한이 없습니다.');
|
||||
}
|
||||
|
||||
if($act == "buy")
|
||||
{
|
||||
if(!count($_POST['ct_chk']))
|
||||
alert("주문하실 상품을 하나이상 선택해 주십시오.");
|
||||
|
||||
if ($act == "d") // 삭제이면
|
||||
$fldcnt = count($_POST['it_id']);
|
||||
for($i=0; $i<$fldcnt; $i++) {
|
||||
$ct_chk = $_POST['ct_chk'][$i];
|
||||
if($ct_chk) {
|
||||
$it_id = $_POST['it_id'][$i];
|
||||
$sql = " update {$g4['shop_cart_table']}
|
||||
set ct_select = '1'
|
||||
where it_id = '$it_id' and uq_id = '$tmp_uq_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_member) // 회원인 경우
|
||||
goto_url(G4_SHOP_URL.'/orderform.php');
|
||||
else
|
||||
goto_url(G4_BBS_URL.'/login.php?url='.urlencode(G4_SHOP_URL.'/orderform.php'));
|
||||
}
|
||||
else if ($act == "d") // 삭제이면
|
||||
{
|
||||
$sql = " delete from {$g4['shop_cart_table']}
|
||||
where ct_id = '$ct_id'
|
||||
@ -38,10 +59,10 @@ else if ($act == "alldelete") // 모두 삭제이면
|
||||
}
|
||||
else if ($act == "seldelete") // 선택삭제
|
||||
{
|
||||
$fldcnt = count($_POST['it_id']);
|
||||
if(!$fldcnt)
|
||||
if(!count($_POST['ct_chk']))
|
||||
alert("삭제하실 상품을 하나이상 선택해 주십시오.");
|
||||
|
||||
$fldcnt = count($_POST['it_id']);
|
||||
for($i=0; $i<$fldcnt; $i++) {
|
||||
$ct_chk = $_POST['ct_chk'][$i];
|
||||
if($ct_chk) {
|
||||
@ -326,10 +347,15 @@ else // 장바구니에 담기
|
||||
else
|
||||
$ct_num = 0;
|
||||
|
||||
if($sw_direct)
|
||||
$ct_select = 1;
|
||||
else
|
||||
$ct_select = 0;
|
||||
|
||||
$ct_count = 0;
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g4['shop_cart_table']}
|
||||
( uq_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, io_id, io_type, io_price, ct_time, ct_ip, ct_direct )
|
||||
( uq_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, io_id, io_type, io_price, ct_time, ct_ip, ct_direct, ct_select )
|
||||
VALUES ";
|
||||
|
||||
for($i=0; $i<$option_count; $i++) {
|
||||
@ -350,7 +376,7 @@ else // 장바구니에 담기
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$ct_num', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct' )";
|
||||
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$ct_num', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct', '$ct_select' )";
|
||||
$comma = ' , ';
|
||||
$ct_num++;
|
||||
$ct_count++;
|
||||
|
||||
@ -18,9 +18,6 @@ else {
|
||||
if (get_cart_count($tmp_uq_id) == 0)
|
||||
alert('장바구니가 비어 있습니다.', G4_SHOP_URL.'/cart.php');
|
||||
|
||||
// 포인트 결제 대기 필드 추가
|
||||
//sql_query(" ALTER TABLE `$g4[shop_order_table]` ADD `od_temp_point` INT NOT NULL AFTER `od_temp_card` ", false);
|
||||
|
||||
$g4['title'] = '주문서 작성';
|
||||
|
||||
include_once('./_head.php');
|
||||
@ -148,6 +145,7 @@ setTimeout("init_pay_button();",300);
|
||||
b.ca_id3
|
||||
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
|
||||
where a.uq_id = '$s_uq_id'
|
||||
and a.ct_select = '1'
|
||||
and a.ct_num = '0' ";
|
||||
if($default['de_cart_keep_term']) {
|
||||
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
|
||||
@ -245,7 +243,8 @@ setTimeout("init_pay_button();",300);
|
||||
} // for 끝
|
||||
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="7" class="empty_table">장바구니에 담긴 상품이 없습니다.</td></tr>';
|
||||
//echo '<tr><td colspan="7" class="empty_table">장바구니에 담긴 상품이 없습니다.</td></tr>';
|
||||
alert('장바구니가 비어 있습니다.', G4_SHOP_URL.'/cart.php');
|
||||
} else {
|
||||
// 배송비 계산
|
||||
if ($default['de_send_cost_case'] == '없음')
|
||||
|
||||
@ -20,7 +20,7 @@ else
|
||||
$tmp_uq_id = get_session('ss_uq_id');
|
||||
|
||||
if (get_cart_count($tmp_uq_id) == 0)// 장바구니에 담기
|
||||
alert('장바구니가 비어 있습니다.\\n\\n이미 주문하셨거나 장바구니에 담긴 상품이 없는 경우입니다.', './cart.php');
|
||||
alert('장바구니가 비어 있습니다.\\n\\n이미 주문하셨거나 장바구니에 담긴 상품이 없는 경우입니다.', G4_SHOP_URL.'/cart.php');
|
||||
|
||||
$error = "";
|
||||
// 장바구니 상품 재고 검사
|
||||
@ -31,7 +31,8 @@ $sql = " select it_id,
|
||||
io_type,
|
||||
ct_option
|
||||
from {$g4['shop_cart_table']}
|
||||
where uq_id = '$tmp_uq_id' ";
|
||||
where uq_id = '$tmp_uq_id'
|
||||
and ct_select = '1' ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
@ -46,6 +47,9 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
$error .= "{$row['ct_option']} 의 재고수량이 부족합니다. 현재고수량 : $it_stock_qty 개\\n\\n";
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
alert('장바구니가 비어 있습니다.\\n\\n이미 주문하셨거나 장바구니에 담긴 상품이 없는 경우입니다.', G4_SHOP_URL.'/cart.php');
|
||||
|
||||
if ($error != "")
|
||||
{
|
||||
$error .= "다른 고객님께서 {$od_name}님 보다 먼저 주문하신 경우입니다. 불편을 끼쳐 죄송합니다.";
|
||||
@ -59,7 +63,7 @@ $i_temp_point = (int)$_POST['od_temp_point'];
|
||||
|
||||
// 주문금액이 상이함
|
||||
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_amount
|
||||
from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' ";
|
||||
from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and ct_select = '1' ";
|
||||
$row = sql_fetch($sql);
|
||||
$tot_ct_amount = $row['od_amount'];
|
||||
|
||||
@ -106,7 +110,8 @@ if($is_member) {
|
||||
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
|
||||
from {$g4['shop_cart_table']}
|
||||
where uq_id = '$tmp_uq_id'
|
||||
and it_id = '$it_id' ";
|
||||
and it_id = '$it_id'
|
||||
and ct_select = '1' ";
|
||||
$ct = sql_fetch($sql);
|
||||
$item_price = $ct['sum_price'];
|
||||
|
||||
@ -366,10 +371,13 @@ else
|
||||
// 주문번호를 얻는다.
|
||||
$od_id = get_session('ss_order_uniqid');
|
||||
|
||||
// 주문상품의 uq_id 변경을 위한 uq_id를 얻는다.
|
||||
$uq_id = get_uniqid();
|
||||
|
||||
// 주문서에 입력
|
||||
$sql = " insert {$g4['shop_order_table']}
|
||||
set od_id = '$od_id',
|
||||
uq_id = '$tmp_uq_id',
|
||||
uq_id = '$uq_id',
|
||||
mb_id = '{$member['mb_id']}',
|
||||
od_pwd = '$od_pwd',
|
||||
od_name = '$od_name',
|
||||
@ -431,9 +439,11 @@ if (($od_receipt_card > 0 || $od_receipt_hp > 0) && $default['de_card_point'] ==
|
||||
$sql_card_point = " , ct_point = '0' ";
|
||||
}
|
||||
$sql = "update {$g4['shop_cart_table']}
|
||||
set ct_status = '주문'
|
||||
set uq_id = '$uq_id',
|
||||
ct_status = '주문'
|
||||
$sql_card_point
|
||||
where uq_id = '$tmp_uq_id' ";
|
||||
where uq_id = '$tmp_uq_id'
|
||||
and ct_select = '1' ";
|
||||
$result = sql_query($sql, false);
|
||||
|
||||
// 주문정보 입력 오류시 kcp 결제 취소
|
||||
@ -446,7 +456,7 @@ if(!$result) {
|
||||
echo "<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['PHP_SELF']}";
|
||||
|
||||
// 주문삭제
|
||||
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$tmp_uq_id' ");
|
||||
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -482,8 +492,9 @@ if($is_member) {
|
||||
$cp_amt = (int)$arr_it_cp_amt[$cp_it_id];
|
||||
$sql = " update {$g4['shop_cart_table']}
|
||||
set cp_amount = '$cp_amt'
|
||||
where uq_id = '$tmp_uq_id'
|
||||
where uq_id = '$uq_id'
|
||||
and it_id = '$cp_it_id'
|
||||
and ct_select = '1'
|
||||
and ct_num = '0' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
@ -556,20 +567,14 @@ if($default['de_sms_use'] && ($default['de_sms_use2'] || $default['de_sms_use3']
|
||||
|
||||
|
||||
// orderview 에서 사용하기 위해 tmp에 넣고
|
||||
set_session('ss_temp_uq_id', $tmp_uq_id);
|
||||
set_session('ss_temp_uq_id', $uq_id);
|
||||
|
||||
// 주문번호제거
|
||||
set_session('ss_order_uniqid', '');
|
||||
|
||||
// ss_uq_id 기존자료 세션에서 제거
|
||||
// 기존자료 세션에서 제거
|
||||
if (get_session('ss_direct'))
|
||||
set_session('ss_uq_direct', '');
|
||||
else
|
||||
set_session('ss_uq_id', '');
|
||||
|
||||
// 비회원장바구니 쿠키 초기화
|
||||
if(get_cookie('ck_guest_cart_uqid'))
|
||||
set_cookie('ck_guest_cart_uqid', '', 0);
|
||||
|
||||
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uq_id='.$tmp_uq_id);
|
||||
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uq_id='.$uq_id);
|
||||
?>
|
||||
|
||||
@ -18,7 +18,8 @@ $sql = " select a.it_id,
|
||||
b.it_sell_email,
|
||||
b.it_origin
|
||||
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
|
||||
where a.uq_id = '$tmp_uq_id'
|
||||
where a.uq_id = '$uq_id'
|
||||
and a.ct_select = '1'
|
||||
and a.ct_num = '0' ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
@ -29,13 +30,14 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
SUM(ct_qty) as qty
|
||||
from {$g4['shop_cart_table']}
|
||||
where it_id = '{$row['it_id']}'
|
||||
and uq_id = '$tmp_uq_id' ";
|
||||
and uq_id = '$uq_id'
|
||||
and ct_select = '1' ";
|
||||
$sum = sql_fetch($sql);
|
||||
|
||||
// 옵션정보
|
||||
$sql2 = " select ct_option, ct_qty
|
||||
from {$g4['shop_cart_table']}
|
||||
where it_id = '{$row['it_id']}' and uq_id = '$tmp_uq_id'
|
||||
where it_id = '{$row['it_id']}' and uq_id = '$uq_id' and ct_select = '1'
|
||||
order by io_type asc, ct_num asc, ct_id asc ";
|
||||
$result2 = sql_query($sql2);
|
||||
|
||||
|
||||
@ -39,7 +39,8 @@ $sql = " select b.it_sell_email,
|
||||
a.it_id,
|
||||
a.it_name
|
||||
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
|
||||
where a.uq_id = '$tmp_uq_id'
|
||||
where a.uq_id = '$uq_id'
|
||||
and a.ct_select = '1'
|
||||
and a.ct_num = '0'
|
||||
and b.it_sell_email <> '' ";
|
||||
$result = sql_query($sql);
|
||||
@ -51,13 +52,14 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
SUM(ct_qty) as qty
|
||||
from {$g4['shop_cart_table']}
|
||||
where it_id = '{$row['it_id']}'
|
||||
and uq_id = '$tmp_uq_id' ";
|
||||
and uq_id = '$uq_id'
|
||||
and ct_select = '1' ";
|
||||
$sum = sql_fetch($sql);
|
||||
|
||||
// 옵션정보
|
||||
$sql2 = " select ct_option, ct_qty
|
||||
from {$g4['shop_cart_table']}
|
||||
where it_id = '{$row['it_id']}' and uq_id = '$tmp_uq_id'
|
||||
where it_id = '{$row['it_id']}' and uq_id = '$uq_id' and ct_select = '1'
|
||||
order by io_type asc, ct_num asc, ct_id asc ";
|
||||
$result2 = sql_query($sql2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user