first commit 2
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
include_once('../../common.php');
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
|
||||
|
||||
ob_start();
|
||||
|
||||
header("Content-Type: text/html; charset=utf-8");
|
||||
|
||||
/*
|
||||
구분 태그명 내용 설명 크기
|
||||
<<<tocnt>>> 전체상품수
|
||||
<<<begin>>> 시작 상품시작 알림 필수
|
||||
<<<mapid>>> 상품ID 해당사 상품 ID 필수
|
||||
<<<lprice>>> 원판매가(할인전가격) 선택적필수
|
||||
<<<price>>> 할인적용가 할인후가격 필수
|
||||
<<<mprice>>> 모바일 할인적용가 할인후가격 선택적필수
|
||||
<<<pname>>> 상품명 상품명 필수,varchar(500)
|
||||
<<<pgurl>>> 상품링크 해당 상품으로 갈 상품URL 필수
|
||||
<<<igurl>>> 이미지링크 상품이미지 링크
|
||||
(상품이미지 중 제일 큰이미지링크) 필수,varchar(255)
|
||||
<<<cate1>>> 카테고리명 대분류명 필수
|
||||
<<<caid1>>> 카테고리 ID(대분류) 필수
|
||||
<<<cate2>>> 카테고리명 중분류명
|
||||
<<<caid2>>> 카테고리 ID(중분류)
|
||||
<<<cate3>>> 카테고리명 소분류명
|
||||
<<<caid3>>> 카테고리 ID(소분류)
|
||||
<<<cate4>>> 카테고리명 세분류명
|
||||
<<<caid4>>> 카테고리 ID(세분류)
|
||||
|
||||
<<<model>>> 모델명
|
||||
<<<brand>>> 브랜드명
|
||||
<<<maker>>> 제조사
|
||||
|
||||
<<<coupo>>> 쿠폰/제휴쿠폰
|
||||
<<<mcoupo>>> 모바일 쿠폰/제휴쿠폰
|
||||
<<<pcard>>> 무이자할부
|
||||
<<<point>>> 적립금/포인트
|
||||
<<<deliv>>> 배송비 무료일 때는 0, 유료일 때는 배송금액, 착불은 -1
|
||||
<<<event>>> 이벤트
|
||||
<<<weight>>> 가중치값
|
||||
|
||||
<<<selid>>> 셀러 ID 선택
|
||||
<<<insco>>> 별도설치비
|
||||
<<<ftend>>> 끝알림 필수
|
||||
*/
|
||||
|
||||
$lt = "<<<";
|
||||
$gt = ">>>";
|
||||
$shop_url = G5_SHOP_URL;
|
||||
$data_url = G5_DATA_URL;
|
||||
|
||||
$sql =" select * from {$g5['g5_shop_item_table']} where it_use = '1' and it_soldout = '0' order by ca_id";
|
||||
$result = sql_query($sql);
|
||||
$totcnt = sql_num_rows($result);
|
||||
|
||||
echo $lt.'tocnt'.$gt.$totcnt.PHP_EOL;
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$cate1 = $cate2 = $cate3 = $cate4 = "";
|
||||
|
||||
$row2 = sql_fetch(" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '".substr($row['ca_id'],0,2)."' ");
|
||||
$cate1 = $row2['ca_name'];
|
||||
$caid1 = $row2['ca_id'];
|
||||
|
||||
$cate2 = $cate3 = $cate4 = "";
|
||||
$caid2 = $caid3 = $caid4 = "";
|
||||
|
||||
if (strlen($row['ca_id']) >= 8) {
|
||||
$row2 = sql_fetch(" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '".substr($row['ca_id'],0,8)."' ");
|
||||
$cate4 = $row2['ca_name'];
|
||||
$caid4 = $row2['ca_id'];
|
||||
}
|
||||
|
||||
if (strlen($row['ca_id']) >= 6) {
|
||||
$row2 = sql_fetch(" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '".substr($row['ca_id'],0,6)."' ");
|
||||
$cate3 = $row2['ca_name'];
|
||||
$caid3 = $row2['ca_id'];
|
||||
}
|
||||
|
||||
if (strlen($row['ca_id']) >= 4) {
|
||||
$row2 = sql_fetch(" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '".substr($row['ca_id'],0,4)."' ");
|
||||
$cate2 = $row2['ca_name'];
|
||||
$caid2 = $row2['ca_id'];
|
||||
}
|
||||
|
||||
$point = get_item_point($row);
|
||||
if( $point ){
|
||||
$point .= '원';
|
||||
}
|
||||
|
||||
// 배송비계산
|
||||
$deliv = get_item_sendcost2($row['it_id'], $row['it_price'], 1);
|
||||
|
||||
// 상품이미지
|
||||
$img_url = get_it_imageurl($row['it_id']);
|
||||
|
||||
$str = "{$lt}begin{$gt}".PHP_EOL;
|
||||
$str .= "{$lt}mapid{$gt}{$row['it_id']}".PHP_EOL;
|
||||
$str .= "{$lt}price{$gt}{$row['it_price']}".PHP_EOL;
|
||||
$str .= "{$lt}pname{$gt}{$row['it_name']}".PHP_EOL;
|
||||
$str .= "{$lt}pgurl{$gt}".shop_item_url($row['it_id']).PHP_EOL;
|
||||
$str .= "{$lt}igurl{$gt}$img_url".PHP_EOL;
|
||||
$str .= "{$lt}cate1{$gt}$cate1".PHP_EOL;
|
||||
$str .= "{$lt}caid1{$gt}$caid1".PHP_EOL;
|
||||
if( $cate2 ){
|
||||
$str .= "{$lt}cate2{$gt}$cate2".PHP_EOL;
|
||||
}
|
||||
if( $caid2 ){
|
||||
$str .= "{$lt}caid2{$gt}$caid2".PHP_EOL;
|
||||
}
|
||||
if( $cate3 ){
|
||||
$str .= "{$lt}cate3{$gt}$cate3".PHP_EOL;
|
||||
}
|
||||
if( $caid3 ){
|
||||
$str .= "{$lt}caid3{$gt}$caid3".PHP_EOL;
|
||||
}
|
||||
if( $cate4 ){
|
||||
$str .= "{$lt}cate4{$gt}$cate4".PHP_EOL;
|
||||
}
|
||||
if( $caid4 ){
|
||||
$str .= "{$lt}caid4{$gt}$caid4".PHP_EOL;
|
||||
}
|
||||
if( $row['it_model'] ){
|
||||
$str .= "{$lt}model{$gt}{$row['it_model']}".PHP_EOL;
|
||||
}
|
||||
if( $row['it_brand'] ){
|
||||
$str .= "{$lt}brand{$gt}{$row['it_brand']}".PHP_EOL;
|
||||
}
|
||||
if( $row['it_maker'] ){
|
||||
$str .= "{$lt}maker{$gt}{$row['it_maker']}".PHP_EOL;
|
||||
}
|
||||
$str .= "{$lt}point{$gt}$point".PHP_EOL;
|
||||
$str .= "{$lt}deliv{$gt}$deliv".PHP_EOL;
|
||||
$str .= "{$lt}ftend{$gt}".PHP_EOL;
|
||||
|
||||
echo iconv('utf-8', 'euc-kr', $str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
echo $content;
|
||||
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
ob_start();
|
||||
|
||||
header("Content-Type: text/html; charset=utf-8");
|
||||
|
||||
/*
|
||||
구분 태그명 내용 설명 크기
|
||||
<<<begin>>> 시작 상품시작 알림 필수
|
||||
<<<mapid>>> 상품ID 해당사 상품 ID 필수
|
||||
<<<lprice>>> 원판매가(할인전가격) 선택적필수
|
||||
<<<price>>> 할인적용가 할인후가격 필수
|
||||
<<<mprice>>> 모바일 할인적용가 할인후가격 선택적필수
|
||||
<<<pname>>> 상품명 상품명 필수,varchar(500)
|
||||
<<<pgurl>>> 상품링크 해당 상품으로 갈 상품URL 필수
|
||||
<<<igurl>>> 이미지링크 상품이미지 링크
|
||||
(상품이미지 중 제일 큰이미지링크) 필수,varchar(255)
|
||||
<<<cate1>>> 카테고리명 대분류명 필수
|
||||
<<<caid1>>> 카테고리 ID(대분류) 필수
|
||||
<<<cate2>>> 카테고리명 중분류명
|
||||
<<<caid2>>> 카테고리 ID(중분류)
|
||||
<<<cate3>>> 카테고리명 소분류명
|
||||
<<<caid3>>> 카테고리 ID(소분류)
|
||||
<<<cate4>>> 카테고리명 세분류명
|
||||
<<<caid4>>> 카테고리 ID(세분류)
|
||||
|
||||
<<<model>>> 모델명
|
||||
<<<brand>>> 브랜드명
|
||||
<<<maker>>> 제조사
|
||||
|
||||
<<<coupo>>> 쿠폰/제휴쿠폰
|
||||
<<<mcoupo>>> 모바일 쿠폰/제휴쿠폰
|
||||
<<<pcard>>> 무이자할부
|
||||
<<<point>>> 적립금/포인트
|
||||
<<<deliv>>> 배송비 무료일 때는 0, 유료일 때는 배송금액, 착불은 -1
|
||||
<<<event>>> 이벤트
|
||||
<<<weight>>> 가중치값
|
||||
|
||||
<<<selid>>> 셀러 ID 선택
|
||||
<<<insco>>> 별도설치비
|
||||
<<<ftend>>> 끝알림 필수
|
||||
*/
|
||||
|
||||
$lt = "<<<";
|
||||
$gt = ">>>";
|
||||
$shop_url = G5_SHOP_URL;
|
||||
$data_url = G5_DATA_URL;
|
||||
|
||||
$sql =" select * from {$g5['g5_shop_item_table']} where it_use = '1' and substring(it_update_time, 1, 10) = '".G5_TIME_YMD."' order by ca_id";
|
||||
$result = sql_query($sql);
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$cate1 = $cate2 = $cate3 = $cate4 = "";
|
||||
|
||||
$row2 = sql_fetch(" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '".substr($row['ca_id'],0,2)."' ");
|
||||
$cate1 = $row2['ca_name'];
|
||||
$caid1 = $row2['ca_id'];
|
||||
|
||||
$cate2 = $cate3 = $cate4 = "";
|
||||
$caid2 = $caid3 = $caid4 = "";
|
||||
|
||||
if (strlen($row['ca_id']) >= 8) {
|
||||
$row2 = sql_fetch(" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '".substr($row['ca_id'],0,8)."' ");
|
||||
$cate4 = $row2['ca_name'];
|
||||
$caid4 = $row2['ca_id'];
|
||||
}
|
||||
|
||||
if (strlen($row['ca_id']) >= 6) {
|
||||
$row2 = sql_fetch(" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '".substr($row['ca_id'],0,6)."' ");
|
||||
$cate3 = $row2['ca_name'];
|
||||
$caid3 = $row2['ca_id'];
|
||||
}
|
||||
|
||||
if (strlen($row['ca_id']) >= 4) {
|
||||
$row2 = sql_fetch(" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '".substr($row['ca_id'],0,4)."' ");
|
||||
$cate2 = $row2['ca_name'];
|
||||
$caid2 = $row2['ca_id'];
|
||||
}
|
||||
|
||||
$point = get_item_point($row);
|
||||
if( $point ){
|
||||
$point .= '원';
|
||||
}
|
||||
|
||||
// 배송비계산
|
||||
$deliv = get_item_sendcost2($row['it_id'], $row['it_price'], 1);
|
||||
|
||||
// 상품이미지
|
||||
$img_url = get_it_imageurl($row['it_id']);
|
||||
|
||||
// 상태
|
||||
$class = 'U';
|
||||
$stock_qty = get_it_stock_qty($row['it_id']);
|
||||
|
||||
if(substr($row['it_time'], 0, 10) == G5_TIME_YMD && $row['it_update_time'] >= $row['it_time'])
|
||||
$class = 'I';
|
||||
|
||||
if($row['it_soldout'] || $stock_qty < 0)
|
||||
$class = 'D';
|
||||
|
||||
// 수정시간
|
||||
$utime = str_replace(array('-', ' ', ':'), '', $row['it_update_time']);
|
||||
|
||||
$str = "{$lt}begin{$gt}".PHP_EOL;
|
||||
$str .= "{$lt}mapid{$gt}{$row['it_id']}".PHP_EOL;
|
||||
$str .= "{$lt}price{$gt}{$row['it_price']}".PHP_EOL;
|
||||
$str .= "{$lt}class{$gt}$class".PHP_EOL;
|
||||
$str .= "{$lt}utime{$gt}$utime".PHP_EOL;
|
||||
$str .= "{$lt}pname{$gt}{$row['it_name']}".PHP_EOL;
|
||||
$str .= "{$lt}pgurl{$gt}".shop_item_url($row['it_id']).PHP_EOL;
|
||||
$str .= "{$lt}igurl{$gt}$img_url".PHP_EOL;
|
||||
$str .= "{$lt}cate1{$gt}$cate1".PHP_EOL;
|
||||
$str .= "{$lt}caid1{$gt}$caid1".PHP_EOL;
|
||||
if( $cate2 ){
|
||||
$str .= "{$lt}cate2{$gt}$cate2".PHP_EOL;
|
||||
}
|
||||
if( $caid2 ){
|
||||
$str .= "{$lt}caid2{$gt}$caid2".PHP_EOL;
|
||||
}
|
||||
if( $cate3 ){
|
||||
$str .= "{$lt}cate3{$gt}$cate3".PHP_EOL;
|
||||
}
|
||||
if( $caid3 ){
|
||||
$str .= "{$lt}caid3{$gt}$caid3".PHP_EOL;
|
||||
}
|
||||
if( $cate4 ){
|
||||
$str .= "{$lt}cate4{$gt}$cate4".PHP_EOL;
|
||||
}
|
||||
if( $caid4 ){
|
||||
$str .= "{$lt}caid4{$gt}$caid4".PHP_EOL;
|
||||
}
|
||||
if( $row['it_model'] ){
|
||||
$str .= "{$lt}model{$gt}{$row['it_model']}".PHP_EOL;
|
||||
}
|
||||
if( $row['it_brand'] ){
|
||||
$str .= "{$lt}brand{$gt}{$row['it_brand']}".PHP_EOL;
|
||||
}
|
||||
if( $row['it_maker'] ){
|
||||
$str .= "{$lt}maker{$gt}{$row['it_maker']}".PHP_EOL;
|
||||
}
|
||||
$str .= "{$lt}point{$gt}$point".PHP_EOL;
|
||||
$str .= "{$lt}deliv{$gt}$deliv".PHP_EOL;
|
||||
$str .= "{$lt}ftend{$gt}".PHP_EOL;
|
||||
|
||||
echo iconv('utf-8', 'euc-kr', $str);
|
||||
}
|
||||
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
echo $content;
|
||||
@@ -0,0 +1,93 @@
|
||||
<?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(empty($var)) continue;
|
||||
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,0 +1,103 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
// clean the output buffer
|
||||
ob_end_clean();
|
||||
|
||||
/*
|
||||
EP 버전 3.0
|
||||
|
||||
네이버지식쇼핑상품EP (Engine Page) 제작및연동가이드 (제휴사제공용)
|
||||
http://join.shopping.naver.com/misc/download/ep_guide.nhn
|
||||
|
||||
Field Status Notes
|
||||
id 필수 판매하는 상품의 유니크한 상품ID
|
||||
title 필수 실제 서비스에 반영될 상품명(Title)
|
||||
price_pc 필수 상품가격
|
||||
link 필수 상품URL
|
||||
image_link 필수 해당 상품의 이미지URL
|
||||
category_name1 필수 카테고리명(대분류)
|
||||
category_name2 권장 카테고리명(중분류)
|
||||
category_name3 권장 카테고리명(소분류)
|
||||
category_name4 권장 카테고리명(세분류)
|
||||
model_number 권장 모델명
|
||||
brand 권장 브랜드
|
||||
maker 권장 제조사
|
||||
origin 권장 원산지
|
||||
event_words 권장 이벤트
|
||||
coupon 권장 쿠폰
|
||||
interest_free_event 권장 무이자
|
||||
point 권장 포인트
|
||||
shipping 필수 배송료
|
||||
seller_id 권장 셀러 ID (오픈마켓에 한함)
|
||||
class 필수(요약) I (신규상품) / U (업데이트 상품) / D (품절상품)
|
||||
update_time 필수(요약) 상품정보 생성 시각
|
||||
*/
|
||||
|
||||
$tab = "\t";
|
||||
|
||||
ob_start();
|
||||
|
||||
echo "id{$tab}title{$tab}price_pc{$tab}link{$tab}image_link{$tab}category_name1{$tab}category_name2{$tab}category_name3{$tab}category_name4{$tab}brand{$tab}maker{$tab}origin{$tab}point{$tab}review_count{$tab}shipping{$tab}class{$tab}update_time";
|
||||
|
||||
$sql =" select * from {$g5['g5_shop_item_table']} where it_use = '1' and it_soldout = '0' and it_tel_inq = '0' and it_price > '0' order by ca_id";
|
||||
$result = sql_query($sql);
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$cate1 = $cate2 = $cate3 = $cate4 = '';
|
||||
$caid1 = $caid2 = $caid3 = $caid4 = '';
|
||||
|
||||
$caid1 = substr($row['ca_id'],0,2);
|
||||
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid1' ");
|
||||
$cate1 = $row2['ca_name'];
|
||||
|
||||
if (strlen($row['ca_id']) >= 8) {
|
||||
$caid4 = substr($row['ca_id'],0,8);
|
||||
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' ");
|
||||
$cate4 = $row2['ca_name'];
|
||||
}
|
||||
|
||||
if (strlen($row['ca_id']) >= 6) {
|
||||
$caid3 = substr($row['ca_id'],0,6);
|
||||
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' ");
|
||||
$cate3 = $row2['ca_name'];
|
||||
}
|
||||
|
||||
if (strlen($row['ca_id']) >= 4) {
|
||||
$caid2 = substr($row['ca_id'],0,4);
|
||||
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' ");
|
||||
$cate2 = $row2['ca_name'];
|
||||
}
|
||||
|
||||
// 배송비계산
|
||||
$delivery = get_item_sendcost2($row['it_id'], $row['it_price'], 1);
|
||||
|
||||
// 상품이미지
|
||||
$img_url = get_it_imageurl($row['it_id']);
|
||||
|
||||
// 포인트
|
||||
$it_point = get_item_point($row);
|
||||
|
||||
$item_link = shop_item_url($row['it_id']);
|
||||
|
||||
// 상태
|
||||
$class = 'U';
|
||||
$stock_qty = get_it_stock_qty($row['it_id']);
|
||||
|
||||
if(substr($row['it_time'], 0, 10) == G5_TIME_YMD && $row['it_update_time'] >= $row['it_time'])
|
||||
$class = 'I';
|
||||
|
||||
if($row['it_soldout'] || $stock_qty < 0)
|
||||
$class = 'D';
|
||||
|
||||
// 리뷰 카운트
|
||||
$review_count = (int) $row['it_use_cnt'];
|
||||
|
||||
echo "\n{$row['it_id']}{$tab}{$row['it_name']}{$tab}{$row['it_price']}{$tab}{$item_link}{$tab}{$img_url}{$tab}{$cate1}{$tab}{$cate2}{$tab}{$cate3}{$tab}{$cate4}{$tab}{$row['it_brand']}{$tab}{$row['it_maker']}{$tab}{$row['it_origin']}{$tab}{$it_point}{$tab}{$review_count}{$tab}{$delivery}{$tab}{$class}{$tab}{$row['it_update_time']}";
|
||||
}
|
||||
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
echo $content;
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
// clean the output buffer
|
||||
ob_end_clean();
|
||||
|
||||
/*
|
||||
EP 버전 3.0
|
||||
|
||||
네이버지식쇼핑상품EP (Engine Page) 제작및연동가이드 (제휴사제공용)
|
||||
http://join.shopping.naver.com/misc/download/ep_guide.nhn
|
||||
|
||||
Field Status Notes
|
||||
id 필수 판매하는 상품의 유니크한 상품ID
|
||||
title 필수 실제 서비스에 반영될 상품명(Title)
|
||||
price_pc 필수 상품가격
|
||||
link 필수 상품URL
|
||||
image_link 필수 해당 상품의 이미지URL
|
||||
category_name1 필수 카테고리명(대분류)
|
||||
category_name2 권장 카테고리명(중분류)
|
||||
category_name3 권장 카테고리명(소분류)
|
||||
category_name4 권장 카테고리명(세분류)
|
||||
model_number 권장 모델명
|
||||
brand 권장 브랜드
|
||||
maker 권장 제조사
|
||||
origin 권장 원산지
|
||||
event_words 권장 이벤트
|
||||
coupon 권장 쿠폰
|
||||
interest_free_event 권장 무이자
|
||||
point 권장 포인트
|
||||
shipping 필수 배송료
|
||||
seller_id 권장 셀러 ID (오픈마켓에 한함)
|
||||
class 필수(요약) I (신규상품) / U (업데이트 상품) / D (품절상품)
|
||||
update_time 필수(요약) 상품정보 생성 시각
|
||||
*/
|
||||
|
||||
$tab = "\t";
|
||||
|
||||
ob_start();
|
||||
|
||||
echo "id{$tab}title{$tab}price_pc{$tab}link{$tab}image_link{$tab}category_name1{$tab}category_name2{$tab}category_name3{$tab}category_name4{$tab}model_number{$tab}brand{$tab}maker{$tab}origin{$tab}point{$tab}shipping{$tab}class{$tab}update_time";
|
||||
|
||||
$sql =" select * from {$g5['g5_shop_item_table']} where it_use = '1' and it_soldout = '0' and it_tel_inq = '0' and it_price > '0' and substring(it_update_time, 1, 10) = '".G5_TIME_YMD."' order by ca_id";
|
||||
$result = sql_query($sql);
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$cate1 = $cate2 = $cate3 = $cate4 = '';
|
||||
$caid1 = $caid2 = $caid3 = $caid4 = '';
|
||||
|
||||
$caid1 = substr($row['ca_id'],0,2);
|
||||
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid1' ");
|
||||
$cate1 = $row2['ca_name'];
|
||||
|
||||
if (strlen($row['ca_id']) >= 8) {
|
||||
$caid4 = substr($row['ca_id'],0,8);
|
||||
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' ");
|
||||
$cate4 = $row2['ca_name'];
|
||||
}
|
||||
|
||||
if (strlen($row['ca_id']) >= 6) {
|
||||
$caid3 = substr($row['ca_id'],0,6);
|
||||
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' ");
|
||||
$cate3 = $row2['ca_name'];
|
||||
}
|
||||
|
||||
if (strlen($row['ca_id']) >= 4) {
|
||||
$caid2 = substr($row['ca_id'],0,4);
|
||||
$row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' ");
|
||||
$cate2 = $row2['ca_name'];
|
||||
}
|
||||
|
||||
// 배송비계산
|
||||
$delivery = get_item_sendcost2($row['it_id'], $row['it_price'], 1);
|
||||
|
||||
// 상품이미지
|
||||
$img_url = get_it_imageurl($row['it_id']);
|
||||
|
||||
// 포인트
|
||||
$it_point = get_item_point($row);
|
||||
|
||||
$item_link = shop_item_url($row['it_id']);
|
||||
|
||||
// 상태
|
||||
$class = 'U';
|
||||
$stock_qty = get_it_stock_qty($row['it_id']);
|
||||
|
||||
if(substr($row['it_time'], 0, 10) == G5_TIME_YMD && $row['it_update_time'] >= $row['it_time'])
|
||||
$class = 'I';
|
||||
|
||||
if($row['it_soldout'] || $stock_qty < 0)
|
||||
$class = 'D';
|
||||
|
||||
echo "\n{$row['it_id']}{$tab}{$row['it_name']}{$tab}{$row['it_price']}{$tab}{$item_link}{$tab}{$img_url}{$tab}{$cate1}{$tab}{$cate2}{$tab}{$cate3}{$tab}{$cate4}{$tab}{$row['it_model']}{$tab}{$row['it_brand']}{$tab}{$row['it_maker']}{$tab}{$row['it_origin']}{$tab}{$it_point}{$tab}{$delivery}{$tab}{$class}{$tab}{$row['it_update_time']}";
|
||||
}
|
||||
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
echo $content;
|
||||
Reference in New Issue
Block a user