Skip to content

Commit

Permalink
Merge branch 'google_price' into v5.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kagla committed Mar 4, 2022
2 parents 694e039 + 40cd036 commit 1123b66
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 22 deletions.
19 changes: 1 addition & 18 deletions adm/config_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,6 @@
<?php echo option_selected("", $config['cf_cert_hp'], "사용안함"); ?>
<?php echo option_selected("kcb", $config['cf_cert_hp'], "코리아크레딧뷰로(KCB) 휴대폰 본인확인"); ?>
<?php echo option_selected("kcp", $config['cf_cert_hp'], "NHN KCP 휴대폰 본인확인"); ?>
<?php echo option_selected("lg", $config['cf_cert_hp'], "LG유플러스 휴대폰 본인확인"); ?>
</select>
</td>
</tr>
Expand Down Expand Up @@ -914,8 +913,7 @@
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcb_cd">코리아크레딧뷰로<br>KCB 회원사ID</label></th>
<td class="cf_cert_service">
<?php echo help('KCB 회원사ID를 입력해 주십시오.<br>서비스에 가입되어 있지 않다면, KCB와 계약체결 후 회원사ID를 발급 받으실 수 있습니다.<br>이용하시려는 서비스에 대한 계약을 아이핀, 휴대폰 본인확인 각각 체결해주셔야 합니다.<br>아이핀 본인확인 테스트의 경우에는 KCB 회원사ID가 필요 없으나,<br>휴대폰 본인확인 테스트의 경우 KCB 에서 따로 발급 받으셔야 합니다.') ?>
<input type="text" name="cf_cert_kcb_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcb_cd']); ?>" id="cf_cert_kcb_cd" class="frm_input" size="20"> <a href="http://sir.kr/main/service/b_ipin.php" target="_blank" class="btn_frmline">KCB 아이핀 서비스 신청페이지</a>
<a href="http://sir.kr/main/service/b_cert.php" target="_blank" class="btn_frmline">KCB 휴대폰 본인확인 서비스 신청페이지</a>
<input type="text" name="cf_cert_kcb_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcb_cd']); ?>" id="cf_cert_kcb_cd" class="frm_input" size="20">
</td>
</tr>
<tr>
Expand All @@ -926,21 +924,6 @@
<input type="text" name="cf_cert_kcp_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcp_cd']); ?>" id="cf_cert_kcp_cd" class="frm_input" size="3"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a>
</td>
</tr>
<tr>
<th scope="row" class="cf_cert_service"><label for="cf_lg_mid">LG유플러스 상점아이디</label></th>
<td class="cf_cert_service">
<?php echo help('LG유플러스 상점아이디 중 si_를 제외한 나머지 아이디만 입력해 주십시오.<br>서비스에 가입되어 있지 않다면, 본인확인 서비스 신청페이지에서 서비스 신청 후 상점아이디를 발급 받으실 수 있습니다.<br><strong>LG유플러스 휴대폰본인확인은 ActiveX 설치가 필요하므로 Internet Explorer 에서만 사용할 수 있습니다.</strong>') ?>
<span class="sitecode">si_</span>
<input type="text" name="cf_lg_mid" value="<?php echo get_sanitize_input($config['cf_lg_mid']); ?>" id="cf_lg_mid" class="frm_input" size="20"> <a href="http://sir.kr/main/service/lg_cert.php" target="_blank" class="btn_frmline">LG유플러스 본인확인 서비스 신청페이지</a>
</td>
</tr>
<tr>
<th scope="row" class="cf_cert_service"><label for="cf_lg_mert_key">LG유플러스 MERT KEY</label></th>
<td class="cf_cert_service">
<?php echo help('LG유플러스 상점MertKey는 상점관리자 -> 계약정보 -> 상점정보관리에서 확인하실 수 있습니다.') ?>
<input type="text" name="cf_lg_mert_key" value="<?php echo get_sanitize_input($config['cf_lg_mert_key']); ?>" id="cf_lg_mert_key" class="frm_input" size="40">
</td>
</tr>
<tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_limit">본인확인 이용제한</label></th>
<td class="cf_cert_service">
Expand Down
4 changes: 1 addition & 3 deletions adm/config_form_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

$cf_social_servicelist = !empty($_POST['cf_social_servicelist']) ? implode(',', $_POST['cf_social_servicelist']) : '';

$check_keys = array('cf_lg_mid', 'cf_lg_mert_key', 'cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret','cf_cert_kg_cd','cf_cert_kg_mid');
$check_keys = array('cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret','cf_cert_kg_cd','cf_cert_kg_mid');

foreach( $check_keys as $key ){
if ( isset($_POST[$key]) && $_POST[$key] ){
Expand Down Expand Up @@ -285,8 +285,6 @@
cf_cert_kg_mid = '".trim($_POST['cf_cert_kg_mid'])."',
cf_cert_kcb_cd = '{$_POST['cf_cert_kcb_cd']}',
cf_cert_kcp_cd = '{$_POST['cf_cert_kcp_cd']}',
cf_lg_mid = '{$_POST['cf_lg_mid']}',
cf_lg_mert_key = '{$_POST['cf_lg_mert_key']}',
cf_cert_limit = '{$_POST['cf_cert_limit']}',
cf_cert_req = '{$_POST['cf_cert_req']}',
cf_sms_use = '{$_POST['cf_sms_use']}',
Expand Down
20 changes: 19 additions & 1 deletion adm/shop_admin/price.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,32 @@
<p>사이트 명을 클릭하시면 해당 사이트로 이동합니다.</p>

<dl class="price_engine">
<dt><a href="http://shopping.naver.com/" target="_blank">네이버 지식쇼핑</a></dt>
<dt><a href="http://shopping.naver.com/" target="_blank">네이버쇼핑</a></dt>
<dd>
<ul>
<li>입점 안내 : <a href="http://join.shopping.naver.com/join/intro.nhn" target="_blank">http://join.shopping.naver.com/join/intro.nhn</a></li>
<li>전체상품 URL : <a href="<?php echo G5_SHOP_URL; ?>/price/naver.php" target="_blank"><?php echo G5_SHOP_URL; ?>/price/naver.php</a></li>
<li>요약상품 URL : <a href="<?php echo G5_SHOP_URL; ?>/price/naver_summary.php" target="_blank"><?php echo G5_SHOP_URL; ?>/price/naver_summary.php</a></li>
</ul>
</dd>

<dt><a href="" target="_blank">구글 쇼핑</a></dt>
<dd>
<ul>
<li>구글 Merchant Center : <a href="https://www.google.com/intl/ko_kr/retail/solutions/merchant-center" target="_blank">https://www.google.com/intl/ko_kr/retail/solutions/merchant-center</a></li>
<li>파일 이름 : google_feed.php</a></li>
<li>파일 URL : <a href="<?php echo G5_SHOP_URL; ?>/price/google_feed.php" target="_blank"><?php echo G5_SHOP_URL; ?>/price/google_feed.php</a></li>
</ul>
</dd>
<dt>Feed 설명</dt>
<dd>
<ul>
<li>판매국가 <b>대한민국</b>, 언어 <b>한국어</b> 설정 기준입니다.</li>
<li>기본 피드 이름 : 쇼핑몰피드</li>
<li>상품 설명 : <b>it_basic</b> (상품기본설명을 필수 입력해주세요. HTML 태그는 자동 제거됩니다.)</li>
</ul>
</dd>

<dt><a href="http://shopping.daum.net/" target="_blank">다음 쇼핑하우</a></dt>
<dd>
<ul>
Expand Down
1 change: 1 addition & 0 deletions install/gnuboard5.sql
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_icode_pw` varchar(255) NOT NULL DEFAULT '',
`cf_icode_server_ip` varchar(50) NOT NULL DEFAULT '',
`cf_icode_server_port` varchar(50) NOT NULL DEFAULT '',
`cf_icode_token_key` varchar(100) NOT NULL DEFAULT '',
`cf_googl_shorturl_apikey` varchar(50) NOT NULL DEFAULT '',
`cf_social_login_use` tinyint(4) NOT NULL DEFAULT '0',
`cf_social_servicelist` varchar(255) NOT NULL DEFAULT '',
Expand Down
1 change: 1 addition & 0 deletions install/gnuboard5shop.sql
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_default` (
`de_inicis_sign_key` varchar(255) NOT NULL DEFAULT '',
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
`de_easy_pay_use` tinyint(4) NOT NULL DEFAULT '0',
`de_easy_pay_services` varchar(255) NOT NULL DEFAULT '',
`de_samsung_pay_use` tinyint(4) NOT NULL DEFAULT '0',
`de_inicis_lpay_use` tinyint(4) NOT NULL DEFAULT '0',
`de_inicis_kakaopay_use` tinyint(4) NOT NULL DEFAULT '0',
Expand Down
92 changes: 92 additions & 0 deletions shop/price/google_feed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php
include_once("./_common.php");

$sql = "SELECT a.ca_id,
a.ca_adult_use AS ca_adult,
IF( SUBSTR(a.ca_id, 3) != \"\", (SELECT ca_adult_use FROM `{$g5['g5_shop_category_table']}` WHERE ca_id = SUBSTR(a.ca_id, 3)), 0) AS ca_adult_parent1,
IF( SUBSTR(a.ca_id, 5) != \"\", (SELECT ca_adult_use FROM `{$g5['g5_shop_category_table']}` WHERE ca_id = SUBSTR(a.ca_id, 5)), 0) AS ca_adult_parent2,
IF( SUBSTR(a.ca_id, 7) != \"\", (SELECT ca_adult_use FROM `{$g5['g5_shop_category_table']}` WHERE ca_id = SUBSTR(a.ca_id, 7)), 0) AS ca_adult_parent3,
IF( SUBSTR(a.ca_id, 9) != \"\", (SELECT ca_adult_use FROM `{$g5['g5_shop_category_table']}` WHERE ca_id = SUBSTR(a.ca_id, 9)), 0) AS ca_adult_parent4
FROM `{$g5['g5_shop_category_table']}` AS a";
$result = sql_query($sql);

$category_adult_array = array();
for ($i = 0; $row = sql_fetch_array($result); $i++ ) {
$category_adult_array[$row['ca_id']] = array( $row['ca_adult'], // 자기자신 성인인증판단
$row['ca_adult_parent1'], // 1depth 성인인증
$row['ca_adult_parent2'], // 2depth 성인인증
$row['ca_adult_parent3'], // 3depth 성인인증
$row['ca_adult_parent4']); // 4depth 성인인증
}

$sql =" SELECT a.*, IFNULL((SELECT MAX(`io_stock_qty`) FROM `{$g5['g5_shop_item_option_table']}` WHERE `it_id` = a.`it_id` GROUP BY `it_id`), a.`it_stock_qty`) AS in_stock
FROM `{$g5['g5_shop_item_table']}` as a
where a.`it_use` = '1' and a.`it_soldout` = '0' and a.`it_tel_inq` = '0' and a.`it_price` > '0' order by a.`ca_id`";
$result = sql_query($sql);

$xml = new SimpleXMLElement("<rss/>");
$xml->addAttribute("xmlns:xmlns:g", "http://base.google.com/ns/1.0");
$xml->addAttribute("version", "2.0");
$channel = $xml->addChild("channel");
$title = $channel->addChild("title", "쇼핑몰피드");
$link = $channel->addChild("link", G5_URL);
$description = $channel->addChild("description", "");

for ($i = 0; $row = sql_fetch_array($result); $i++) {
$it_id = $row['it_id'];
$it_title = $row['it_name'];
$it_link = shop_item_url($row['it_id']);
$it_basic = strip_tags($row['it_basic']);

$it_image = "";
for($j = 1; $j <= 10; $j++) {
$img = $row['it_img'.$j];

if(empty($img)) continue;

$it_image = G5_DATA_URL."/item/".$img;
break;
}

$stock = "in_stock";
if($row['it_stock_qty'] <= 0) {
$stock = "out_of_stock";
} else {
if($row['in_stock'] <= 0) $stock = "out_of_stock";
}

$item = $channel->addChild("item");
// 필수 입력 항목
$item->addChild("g:g:id", $it_id);
$item->addChild("title", $it_title);
$item->addChild("description", $it_basic);
$item->addChild("link", $it_link);
$item->addChild("g:g:image_link", $it_image);
$item->addChild("g:g:availability", $stock);

if($row['it_cust_price'] != null && $row['it_cust_price'] > 0) {
$item->addChild("g:g:price", sprintf('%.2fKRW', $row['it_cust_price']));
$item->addChild("g:g:sale_price", sprintf('%.2fKRW', $row['it_price']));
} else {
$item->addChild("g:g:price", sprintf('%.2fKRW', $row['it_price']));
}

// 선택적 입력 항목
$item->addChild("g:g:condition", "new");

$cate_array = array($row['ca_id'], $row['ca_id2'], $row['ca_id3']);

$adult = "no";
foreach($cate_array as $key => $var) {
if(in_array(1, $category_adult_array[$var])) {
$adult = "yes";
}
}

$item->addChild("g:g:adult", $adult);
}

header('Content-type: text/xml');
echo $xml->asXML();

?>

0 comments on commit 1123b66

Please sign in to comment.