네이버지식쇼핑 EP 버전 3.0 적용
This commit is contained in:
@ -1,52 +1,94 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
ob_start();
|
||||
// clean the output buffer
|
||||
ob_end_clean();
|
||||
|
||||
/*
|
||||
요약 상품페이지
|
||||
EP 버전 3.0
|
||||
|
||||
Field Status Notes
|
||||
<<<begin>>> 필수 상품의 시작을 알리는 필드
|
||||
<<<mapid>>> 판매하는 상품의 유니크한 상품ID
|
||||
<<<pname>>> 실제 서비스에 반영될 상품명(Title)
|
||||
<<<price>>> 해당 상품의 판매가격
|
||||
<<<class>>> I(신규상품) / U (업데이트상품) / D (품절상품)
|
||||
<<<utime>>> 상품정보 생성 시각
|
||||
<<<ftend>>> 필수 상품의 마지막을 알리는 필드
|
||||
네이버지식쇼핑상품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 필수(요약) 상품정보 생성 시각
|
||||
*/
|
||||
|
||||
$lt = "<<<";
|
||||
$gt = ">>>";
|
||||
$tab = "\t";
|
||||
|
||||
$sql =" select it_id, it_name, it_price, it_time from {$g5['g5_shop_item_table']} where it_use = '1' order by ca_id";
|
||||
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 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_name from {$g5['g5_shop_category_table']} where ca_id = '$caid1' ");
|
||||
$cate1 = $row2['ca_name'];
|
||||
|
||||
$cate2 = $cate3 = $cate4 = "";
|
||||
|
||||
if (strlen($row['ca_id']) >= 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) {
|
||||
$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) {
|
||||
$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 = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
|
||||
|
||||
// 상태
|
||||
$class = 'U';
|
||||
$stock_qty = get_it_stock_qty($row['it_id']);
|
||||
|
||||
$str = '';
|
||||
if(substr($row['it_time'], 0, 10) == G5_TIME_YMD && $row['it_update_time'] >= $row['it_time'])
|
||||
$class = 'I';
|
||||
|
||||
$str .= "{$lt}begin{$gt}\n";
|
||||
$str .= "{$lt}mapid{$gt}{$row['it_id']}\n";
|
||||
if ($stock_qty <= 0)
|
||||
{
|
||||
// 품절 상품 양식
|
||||
$str .= "{$lt}class{$gt}D\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
// 업데이트 상품 양식 & 품절 복구 상품 양식
|
||||
$str .= "{$lt}pname{$gt}{$row['it_name']}\n";
|
||||
$str .= "{$lt}price{$gt}{$row['it_price']}\n";
|
||||
$str .= "{$lt}class{$gt}U\n";
|
||||
}
|
||||
$str .= "{$lt}utime{$gt}{$row['it_time']}\n";
|
||||
$str .= "{$lt}ftend{$gt}\n";
|
||||
if($row['it_soldout'] || $stock_qty < 0)
|
||||
$class = 'D';
|
||||
|
||||
// 091223 : 네이버에서는 아직 utf-8 을 지원하지 않고 있음
|
||||
echo iconv('utf-8', 'euc-kr', $str);
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user