Merge branch 'master' of github.com:gnuboard/yc4s
This commit is contained in:
@ -856,6 +856,20 @@ $pg_anchor = '<ul class="anchor">
|
||||
안내메세지 출력 사용
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_cart_keep_term">장바구니 보관기간</label></th>
|
||||
<td>
|
||||
<?php echo help("장바구니 상품의 보관 기간을 설정하십시오."); ?>
|
||||
<input type="text" name="de_cart_keep_term" value="<?php echo $default['de_cart_keep_term']; ?>" id="de_cart_keep_term" class="frm_input" size="5"> 일
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_guest_cart_use">비회원 장바구니</label></th>
|
||||
<td>
|
||||
<?php echo help("비회원 장바구니 기능을 사용하려면 체크하십시오."); ?>
|
||||
<input type="checkbox" name="de_guest_cart_use" value="1" id="de_guest_cart_use"<?php echo $default['de_guest_cart_use']?' checked':''; ?>> 사용
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">비회원에 대한<br/>개인정보수집 내용</th>
|
||||
<td><?php echo editor_html('de_guest_privacy', $default['de_guest_privacy']); ?></td>
|
||||
|
||||
@ -148,6 +148,8 @@ $sql = " update {$g4['shop_default_table']}
|
||||
de_sms_hp = '$de_sms_hp',
|
||||
de_item_ps_use = '$de_item_ps_use',
|
||||
de_code_dup_use = '$de_code_dup_use',
|
||||
de_cart_keep_term = '$de_cart_keep_term',
|
||||
de_guest_cart_use = '$de_guest_cart_use',
|
||||
de_point_per = '$de_point_per',
|
||||
de_admin_buga_no = '$de_admin_buga_no',
|
||||
de_different_msg = '$de_different_msg',
|
||||
|
||||
@ -21,12 +21,11 @@ include_once(G4_ADMIN_PATH.'/admin.head.php');
|
||||
//------------------------------------------------------------------------------
|
||||
// 설정 시간이 지난 주문서 없는 장바구니 자료 삭제
|
||||
//------------------------------------------------------------------------------
|
||||
if (!isset($cart_not_delete)) {
|
||||
if (!$hours) $hours = 6;
|
||||
$beforehours = date("Y-m-d H:i:s", ( G4_SERVER_TIME - (60 * 60 * $hours) ) );
|
||||
$sql = " delete from {$g4['shop_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforehours' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
$keep_term = $default['de_cart_keep_term'];
|
||||
if (!$keep_term) $keep_term = 15; // 기본값 15일
|
||||
$beforetime = date('Y-m-d H:i:s', ( G4_SERVER_TIME - (86400 * $keep_term) ) );
|
||||
$sql = " delete from {$g4['shop_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforetime' ";
|
||||
sql_query($sql);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@ -84,14 +84,6 @@ if(!$result) {
|
||||
ADD `ct_num` INT(11) NOT NULL DEFAULT '0' AFTER `ct_qty` ", false);
|
||||
}
|
||||
|
||||
// ct_order 추가
|
||||
$sql = " select ct_order from {$g4['shop_cart_table']} limit 1 ";
|
||||
$result = sql_query($sql, false);
|
||||
if(!$result) {
|
||||
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
|
||||
ADD `ct_order` INT(11) NOT NULL DEFAULT '0' AFTER `ct_direct` ", false);
|
||||
}
|
||||
|
||||
// it_brand 추가
|
||||
$sql = " select it_brand from {$g4['shop_item_table']} limit 1 ";
|
||||
$result = sql_query($sql, false);
|
||||
@ -196,4 +188,15 @@ if (!isset($it['it_mobile_explan'])) {
|
||||
ADD `it_mobile_head_html` TEXT NOT NULL AFTER `it_tail_html`,
|
||||
ADD `it_mobile_tail_html` TEXT NOT NULL AFTER `it_mobile_head_html` ", false);
|
||||
}
|
||||
|
||||
// de_guest_cart_use 필드추가
|
||||
$sql = " select de_guest_cart_use from {$g4['shop_default_table']} ";
|
||||
$result = sql_query($sql, false);
|
||||
if(!$result) {
|
||||
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
|
||||
ADD `mb_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `uq_id` ", false);
|
||||
sql_query(" ALTER TABLE `{$g4['shop_default_table']}`
|
||||
ADD `de_cart_keep_term` INT(11) NOT NULL DEFAULT '0' AFTER `de_code_dup_use`,
|
||||
ADD `de_guest_cart_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `de_cart_keep_term` ", false);
|
||||
}
|
||||
?>
|
||||
@ -263,6 +263,7 @@ if($shop_install) {
|
||||
de_card_use = '0',
|
||||
de_card_max_amount = '1000',
|
||||
de_point_settle = '10000',
|
||||
de_cart_keep_term = '15',
|
||||
de_point_per = '5',
|
||||
de_card_point = '0',
|
||||
de_point_days = '7',
|
||||
|
||||
@ -56,6 +56,7 @@ DROP TABLE IF EXISTS `shop_cart`;
|
||||
CREATE TABLE IF NOT EXISTS `shop_cart` (
|
||||
`ct_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`uq_id` bigint(20) unsigned NOT NULL,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`it_id` varchar(20) NOT NULL DEFAULT '',
|
||||
`it_name` varchar(255) NOT NULL DEFAULT '',
|
||||
`ct_status` enum('쇼핑','주문','준비','배송','완료','취소','반품','품절') NOT NULL DEFAULT '쇼핑',
|
||||
@ -248,6 +249,8 @@ CREATE TABLE IF NOT EXISTS `shop_default` (
|
||||
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`de_item_ps_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`de_code_dup_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`de_cart_keep_term` int(11) NOT NULL DEFAULT '0',
|
||||
`de_guest_cart_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`de_point_per` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`de_admin_buga_no` varchar(255) NOT NULL DEFAULT '',
|
||||
`de_different_msg` tinyint(4) NOT NULL DEFAULT '0',
|
||||
|
||||
@ -56,7 +56,7 @@ $sql = " select a.ct_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_num = '0'
|
||||
order by a.ct_order, a.ct_id ";
|
||||
order by a.ct_id ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$good_info = '';
|
||||
|
||||
@ -21,7 +21,7 @@ $sql = " select a.od_id,
|
||||
a.*, "._MISU_QUERY_."
|
||||
from {$g4['shop_order_table']} a
|
||||
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
|
||||
where mb_id = '{$member['mb_id']}'
|
||||
where a.mb_id = '{$member['mb_id']}'
|
||||
group by a.od_id
|
||||
order by a.od_id desc
|
||||
$limit ";
|
||||
|
||||
@ -1,6 +1,23 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
// 회원일 경우 자신의 장바구니 상품 uq_id 값을 변경
|
||||
if($is_member) {
|
||||
$tmp_uq_id = get_session('ss_uq_id');
|
||||
if(!$tmp_uq_id) {
|
||||
$tmp_uq_id = get_uniqid();
|
||||
set_session('ss_uq_id', $tmp_uq_id);
|
||||
}
|
||||
|
||||
$ctime = date('Y-m-d H:i:s', (G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400)));
|
||||
$sql = " update {$g4['shop_cart_table']}
|
||||
set uq_id = '$tmp_uq_id'
|
||||
where mb_id = '{$member['mb_id']}'
|
||||
and ct_status = '쇼핑'
|
||||
and ct_time > '$ctime' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if (G4_IS_MOBILE) {
|
||||
include_once(G4_MSHOP_PATH.'/cart.php');
|
||||
return;
|
||||
|
||||
@ -55,7 +55,7 @@ $sql = " select a.ct_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_num = '0'
|
||||
order by a.ct_order, a.ct_id ";
|
||||
order by a.ct_id ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$good_info = '';
|
||||
|
||||
@ -1,6 +1,21 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
// 비회원장바구니 uq_id 쿠키설정
|
||||
if($default['de_guest_cart_use']) {
|
||||
$g_cart_uq_id = get_cookie('ck_guest_cart_uqid');
|
||||
if($g_cart_uq_id) {
|
||||
set_session('ss_uq_id', $g_cart_uq_id);
|
||||
set_cookie('ck_guest_cart_uqid', $g_cart_uq_id, ($default['de_cart_keep_term'] * 86400));
|
||||
} else {
|
||||
if(!$sw_direct) {
|
||||
$tmp_uq_id = get_uniqid();
|
||||
set_session('ss_uq_id', $tmp_uq_id);
|
||||
set_cookie('ck_guest_cart_uqid', $tmp_uq_id, ($default['de_cart_keep_term'] * 86400));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($sw_direct) {
|
||||
$tmp_uq_id = get_session('ss_uq_direct');
|
||||
if(!$tmp_uq_id) {
|
||||
@ -336,7 +351,7 @@ else // 장바구니에 담기
|
||||
$ct_count = 0;
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g4['shop_cart_table']}
|
||||
( uq_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 )
|
||||
VALUES ";
|
||||
|
||||
for($i=0; $i<$option_count; $i++) {
|
||||
@ -357,7 +372,7 @@ else // 장바구니에 담기
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql .= $comma."( '$tmp_uq_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' )";
|
||||
$comma = ' , ';
|
||||
$ct_num++;
|
||||
$ct_count++;
|
||||
|
||||
@ -23,7 +23,7 @@ $sql = " select a.od_id,
|
||||
a.*, "._MISU_QUERY_."
|
||||
from {$g4['shop_order_table']} a
|
||||
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
|
||||
where mb_id = '{$member['mb_id']}'
|
||||
where a.mb_id = '{$member['mb_id']}'
|
||||
group by a.od_id
|
||||
order by a.od_id desc
|
||||
$limit ";
|
||||
|
||||
Reference in New Issue
Block a user