구글 판매자센터 피드

- 상품 관련 query 작업중
This commit is contained in:
loves2tu
2021-12-21 04:40:23 +00:00
parent edb0b849d9
commit f7aac7c467
2 changed files with 53 additions and 0 deletions

23
shop/price/feedtest.xml Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title></title>
<link></link>
<description></description>
<!-- START -->
<item>
<title></title>
<link></link>
<description></description>
<g:image_link></g:image_link>
<g:price></g:price>
<g:condition></g:condition>
<g:id></g:id>
<g:availability></g:availability>
</item>
<!-- END -->
</channel>
</rss>

View File

@ -0,0 +1,30 @@
<?php
include_once("./_common.php");
ob_end_clean();
ob_start();
$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);
$xml = array();
$xml['rss'] = "version=\"2.0\" xmlns:g=\"http:base.google.com/ns/1.0\"";
$xml['channel'] = array(
"title" => "타이틀",
"link" => "링크",
"description" => "몰?루"
);
$items = array();
while($row = sql_fetch_array($result)) {
$items['title'] = $row['it_name'];
$items['link'] = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
$items['description'] = $row['it_basic'];
// $items['g:image_link'] = G5_DATA_PATH.'/item/'.$row['']
}
header('Content-type: text/xml');
echo "<?xml version='1.0' encoding='UTF-8'?>\n";
?>