From f7aac7c46746f86a0162c361d603e388c9bbfc05 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Tue, 21 Dec 2021 04:40:23 +0000 Subject: [PATCH 01/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EC=83=81=ED=92=88=20=EA=B4=80=EB=A0=A8=20query=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/feedtest.xml | 23 +++++++++++++++++++++++ shop/price/google_feed.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 shop/price/feedtest.xml create mode 100644 shop/price/google_feed.php diff --git a/shop/price/feedtest.xml b/shop/price/feedtest.xml new file mode 100644 index 000000000..e955cdd2c --- /dev/null +++ b/shop/price/feedtest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php new file mode 100644 index 000000000..77e0314f9 --- /dev/null +++ b/shop/price/google_feed.php @@ -0,0 +1,30 @@ + '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 "\n"; + +?> \ No newline at end of file From 8faa9ba9a2c49d30384bce510da4c2a15fb8643f Mon Sep 17 00:00:00 2001 From: loves2tu Date: Tue, 21 Dec 2021 07:58:42 +0000 Subject: [PATCH 02/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20echo?= =?UTF-8?q?=20xml=20=EC=83=9D=EC=84=B1=20=EA=B4=80=EB=A0=A8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=A0=81=EC=9A=A9=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 43 +++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 77e0314f9..3578a7be4 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -1,6 +1,19 @@ $val) { + if(is_numeric($key)) { + $result .= array_xml($val); + } else { + $result .= "<{$key}>".array_xml($val).""; + } + } + return $result; +} + ob_end_clean(); ob_start(); @@ -8,23 +21,33 @@ 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( +$xml = array( "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[''] +for ($i = 0; $row = sql_fetch_array($result); $i++ ) { + if(empty($row['it_img1'])) continue; + if(!file_exists(G5_DATA_PATH.'/item/'.$row['it_img1'])) continue; + + $xml['channel']['item'][$i]['title'] = $row['it_name']; + $xml['channel']['item'][$i]['link'] = G5_SHOP_URL.'/item.php?it_id='.$row['it_id']; + $xml['channel']['item'][$i]['description'] = $row['it_basic']; + $xml['channel']['item'][$i]['g:image_link'] = G5_DATA_URL.'/item/'.$row['it_img1']; + $xml['channel']['item'][$i]['g:condition'] = "new"; + $xml['channel']['item'][$i]['g:id'] = $row['it_id']; } header('Content-type: text/xml'); -echo "\n"; +echo ""; +echo ""; + +foreach($xml as $key => $var) { + echo array_xml($var); +} + +echo ""; ?> \ No newline at end of file From 98b085e73e081ed7d9b10ce90e7996b3a48b7436 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Thu, 23 Dec 2021 02:09:11 +0000 Subject: [PATCH 03/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20query?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 78 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 3578a7be4..2fecac52b 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -1,53 +1,55 @@ $val) { - if(is_numeric($key)) { - $result .= array_xml($val); - } else { - $result .= "<{$key}>".array_xml($val).""; - } - } - return $result; -} - -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"; +$sql =" select *, if((SELECT io_stock_qty FROM `{$g5['g5_shop_item_option_table']}` WHERE it_id = a.it_id GROUP BY it_id HAVING io_stock_qty < 1) != null, 0, 1) as in_stock + from `{$g5['g5_shop_item_table']}` as a + 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( "channel" => array( - "title" => "타이틀", - "link" => "링크", - "description" => "몰?루" -)); +// $xml = new SimpleXMLElement(""); +$xml = new SimpleXMLElement(""); +$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", "링크"); +$description = $channel->addChild("description", "몰?루"); -$items = array(); for ($i = 0; $row = sql_fetch_array($result); $i++ ) { + $item = $channel->addChild("item"); if(empty($row['it_img1'])) continue; if(!file_exists(G5_DATA_PATH.'/item/'.$row['it_img1'])) continue; - $xml['channel']['item'][$i]['title'] = $row['it_name']; - $xml['channel']['item'][$i]['link'] = G5_SHOP_URL.'/item.php?it_id='.$row['it_id']; - $xml['channel']['item'][$i]['description'] = $row['it_basic']; - $xml['channel']['item'][$i]['g:image_link'] = G5_DATA_URL.'/item/'.$row['it_img1']; - $xml['channel']['item'][$i]['g:condition'] = "new"; - $xml['channel']['item'][$i]['g:id'] = $row['it_id']; + $item->addChild("title", $row['it_name']); + $item->addChild("link", G5_SHOP_URL.'/item.php?it_id='.urlencode($row['it_id'])); + $item->addChild("description", strip_tags($row['it_basic'])); + + $ext = explode('.', $row['it_img1'])[1]; + + switch($ext) { + case "jpg": + case "jpeg": + case "webp": + case "png": + case "gif": + case "bmp": + case "tif": + case "tiff": + $ext_check = true; + break; + default: + $ext_check = false; + break; + } + + if($ext_check == false) continue; + $item->addChild("xmlns:g:image_link", G5_DATA_URL.'/item/'.$row['it_img1']); + + $item->addChild("xmlns:g:condition", "new"); + $item->addChild("xmlns:g:id", $row['it_id']); } header('Content-type: text/xml'); -echo ""; -echo ""; - -foreach($xml as $key => $var) { - echo array_xml($var); -} - -echo ""; +echo $xml->asXML(); ?> \ No newline at end of file From 7a2c29f19255e1e6c699e481f364f4ff9fbd4307 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Mon, 27 Dec 2021 05:56:08 +0000 Subject: [PATCH 04/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20query?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20=20-=20=EC=98=88=EC=99=B8=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 2fecac52b..effef0f7c 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -1,29 +1,26 @@ '0' order by ca_id"; +$sql =" SELECT *, (SELECT MIN(`io_stock_qty`) FROM `g5_shop_item_option` WHERE `it_id` = a.`it_id` GROUP BY `it_id`) 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(""); $xml = new SimpleXMLElement(""); $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", "링크"); +$title = $channel->addChild("title", "쇼핑몰피드"); +$link = $channel->addChild("link", G5_URL); $description = $channel->addChild("description", "몰?루"); for ($i = 0; $row = sql_fetch_array($result); $i++ ) { - $item = $channel->addChild("item"); + if($row['in_stock'] != null) { + if($row['in_stock'] <= 0) continue; + } if(empty($row['it_img1'])) continue; if(!file_exists(G5_DATA_PATH.'/item/'.$row['it_img1'])) continue; - $item->addChild("title", $row['it_name']); - $item->addChild("link", G5_SHOP_URL.'/item.php?it_id='.urlencode($row['it_id'])); - $item->addChild("description", strip_tags($row['it_basic'])); - $ext = explode('.', $row['it_img1'])[1]; switch($ext) { @@ -43,10 +40,14 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { } if($ext_check == false) continue; - $item->addChild("xmlns:g:image_link", G5_DATA_URL.'/item/'.$row['it_img1']); - - $item->addChild("xmlns:g:condition", "new"); - $item->addChild("xmlns:g:id", $row['it_id']); + + $item = $channel->addChild("item"); + $item->addChild("title", $row['it_name']); + $item->addChild("link", G5_SHOP_URL.'/item.php?it_id='.urlencode($row['it_id'])); + $item->addChild("description", strip_tags($row['it_basic'])); + $item->addChild("g:g:image_link", G5_DATA_URL.'/item/'.$row['it_img1']); + $item->addChild("g:g:condition", "new"); + $item->addChild("g:g:id", $row['it_id']); } header('Content-type: text/xml'); From 322e5cf83a84183bc3d02225dd8a2c0c2cfe2a61 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Tue, 28 Dec 2021 03:08:28 +0000 Subject: [PATCH 05/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EC=84=B1=EC=9D=B8=EC=9D=B8=EC=A6=9D=EA=B4=80=EB=A0=A8=20catego?= =?UTF-8?q?ry=20=EC=A1=B0=ED=9A=8C=20query=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 51 ++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index effef0f7c..10b06752c 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -1,7 +1,25 @@ '0' order by a.`ca_id`"; $result = sql_query($sql); @@ -15,9 +33,10 @@ $link = $channel->addChild("link", G5_URL); $description = $channel->addChild("description", "몰?루"); for ($i = 0; $row = sql_fetch_array($result); $i++ ) { + $stock = "in_stock"; if($row['in_stock'] != null) { - if($row['in_stock'] <= 0) continue; - } + if($row['in_stock'] <= 0) $stock = "out_of_stock"; + } if(empty($row['it_img1'])) continue; if(!file_exists(G5_DATA_PATH.'/item/'.$row['it_img1'])) continue; @@ -42,12 +61,28 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { if($ext_check == false) continue; $item = $channel->addChild("item"); - $item->addChild("title", $row['it_name']); - $item->addChild("link", G5_SHOP_URL.'/item.php?it_id='.urlencode($row['it_id'])); - $item->addChild("description", strip_tags($row['it_basic'])); - $item->addChild("g:g:image_link", G5_DATA_URL.'/item/'.$row['it_img1']); - $item->addChild("g:g:condition", "new"); + // 필수 입력 항목 $item->addChild("g:g:id", $row['it_id']); + $item->addChild("title", $row['it_name']); + $item->addChild("description", strip_tags($row['it_basic'])); + $item->addChild("link", G5_SHOP_URL.'/item.php?it_id='.urlencode($row['it_id'])); + $item->addChild("g:g:image_link", G5_DATA_URL.'/item/'.$row['it_img1']); + $item->addChild("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"); + $item->addChild("adult", "no"); + if(in_array(1, $category_array[$row['ca_id']])) { + $item->addChild("adult", "yes"); + } + } header('Content-type: text/xml'); From daffdcbfcee8a313510c21488a660570939496fd Mon Sep 17 00:00:00 2001 From: loves2tu Date: Tue, 28 Dec 2021 05:16:19 +0000 Subject: [PATCH 06/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EB=8B=A4=EC=A4=91=EC=B9=B4=ED=85=8C=EB=8F=84=EB=A6=AC=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EC=84=B1=EC=9D=B8=EC=9D=B8=EC=A6=9D=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 10b06752c..14a360217 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -78,11 +78,17 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { // 선택적 입력 항목 $item->addChild("g:g:condition", "new"); - $item->addChild("adult", "no"); - if(in_array(1, $category_array[$row['ca_id']])) { - $item->addChild("adult", "yes"); + + $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_array[$var])) { + $adult = "yes"; + } } - + + $item->addChild("adult", $adult); } header('Content-type: text/xml'); From f25354b1b22174c8794dce5142b2d7147f192a43 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Tue, 28 Dec 2021 05:46:48 +0000 Subject: [PATCH 07/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80=20(it?= =?UTF-8?q?=5Fid,=20it=5Fname)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 14a360217..0ba4e8589 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -10,9 +10,9 @@ $sql = "SELECT a.ca_id, FROM `g5_shop_category` AS a"; $result = sql_query($sql); -$category_array = array(); +$category_adult_array = array(); for ($i = 0; $row = sql_fetch_array($result); $i++ ) { - $category_array[$row['ca_id']] = array( $row['ca_adult'], // 자기자신 성인인증판단 + $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 성인인증 @@ -33,13 +33,10 @@ $link = $channel->addChild("link", G5_URL); $description = $channel->addChild("description", "몰?루"); for ($i = 0; $row = sql_fetch_array($result); $i++ ) { - $stock = "in_stock"; - if($row['in_stock'] != null) { - if($row['in_stock'] <= 0) $stock = "out_of_stock"; - } + if(empty($row['it_id'])) continue; + if(empty($row['it_name'])) continue; if(empty($row['it_img1'])) continue; if(!file_exists(G5_DATA_PATH.'/item/'.$row['it_img1'])) continue; - $ext = explode('.', $row['it_img1'])[1]; switch($ext) { @@ -59,6 +56,11 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { } if($ext_check == false) continue; + + $stock = "in_stock"; + if($row['in_stock'] != null) { + if($row['in_stock'] <= 0) $stock = "out_of_stock"; + } $item = $channel->addChild("item"); // 필수 입력 항목 @@ -83,7 +85,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { $adult = "no"; foreach($cate_array as $key => $var) { - if(in_array(1, $category_array[$var])) { + if(in_array(1, $category_adult_array[$var])) { $adult = "yes"; } } From c82c33fc59dfcf42e1482e3c3081ceecaccb995a Mon Sep 17 00:00:00 2001 From: loves2tu Date: Wed, 29 Dec 2021 06:29:16 +0000 Subject: [PATCH 08/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20img1~10=20=EC=A1=B4=EC=9E=AC?= =?UTF-8?q?=EC=97=AC=EB=B6=80=20=ED=99=95=EC=9D=B8=20=ED=9B=84=20=20image?= =?UTF-8?q?=5Flink=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 45 +++++++++++++++----------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 0ba4e8589..42b37a606 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -30,33 +30,24 @@ $xml->addAttribute("version", "2.0"); $channel = $xml->addChild("channel"); $title = $channel->addChild("title", "쇼핑몰피드"); $link = $channel->addChild("link", G5_URL); -$description = $channel->addChild("description", "몰?루"); +$description = $channel->addChild("description", ""); for ($i = 0; $row = sql_fetch_array($result); $i++ ) { - if(empty($row['it_id'])) continue; - if(empty($row['it_name'])) continue; - if(empty($row['it_img1'])) continue; - if(!file_exists(G5_DATA_PATH.'/item/'.$row['it_img1'])) continue; - $ext = explode('.', $row['it_img1'])[1]; + $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']); - switch($ext) { - case "jpg": - case "jpeg": - case "webp": - case "png": - case "gif": - case "bmp": - case "tif": - case "tiff": - $ext_check = true; - break; - default: - $ext_check = false; - break; + $it_image = ""; + for($i=1; $i<=10; $i++) { + $img = $row['it_img'.$i]; + + if(empty($img)) continue; + + $it_image = G5_DATA_URL."/item/".$img; + break; } - if($ext_check == false) continue; - $stock = "in_stock"; if($row['in_stock'] != null) { if($row['in_stock'] <= 0) $stock = "out_of_stock"; @@ -64,11 +55,11 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { $item = $channel->addChild("item"); // 필수 입력 항목 - $item->addChild("g:g:id", $row['it_id']); - $item->addChild("title", $row['it_name']); - $item->addChild("description", strip_tags($row['it_basic'])); - $item->addChild("link", G5_SHOP_URL.'/item.php?it_id='.urlencode($row['it_id'])); - $item->addChild("g:g:image_link", G5_DATA_URL.'/item/'.$row['it_img1']); + $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("availability", $stock); if($row['it_cust_price'] != null && $row['it_cust_price'] > 0) { From 4c297a1e5364bc74cde627178993f1e231c0220a Mon Sep 17 00:00:00 2001 From: loves2tu Date: Thu, 30 Dec 2021 05:04:36 +0000 Subject: [PATCH 09/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EB=B0=98=EB=B3=B5=EB=AC=B8=20=EB=B3=80=EC=88=98=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 42b37a606..e9d3ef1b2 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -32,15 +32,15 @@ $title = $channel->addChild("title", "쇼핑몰피드"); $link = $channel->addChild("link", G5_URL); $description = $channel->addChild("description", ""); -for ($i = 0; $row = sql_fetch_array($result); $i++ ) { +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($i=1; $i<=10; $i++) { - $img = $row['it_img'.$i]; + for($j = 1; $j <= 10; $j++) { + $img = $row['it_img'.$j]; if(empty($img)) continue; From bddbcd5cddefd81627cfe33862d5b5e16e2fc9c2 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Thu, 30 Dec 2021 05:42:30 +0000 Subject: [PATCH 10/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20query?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20(table=20=EC=A1=B0=ED=9A=8C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index e9d3ef1b2..8e395652e 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -3,11 +3,11 @@ 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_shop_category` 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_shop_category` 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_shop_category` 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_shop_category` WHERE ca_id = SUBSTR(a.ca_id, 9)), 0) AS ca_adult_parent4 - FROM `g5_shop_category` AS a"; + 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(); @@ -19,7 +19,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { $row['ca_adult_parent4']); // 4depth 성인인증 } -$sql =" SELECT a.*, (SELECT MIN(`io_stock_qty`) FROM `g5_shop_item_option` WHERE `it_id` = a.`it_id` GROUP BY `it_id`) AS in_stock +$sql =" SELECT a.*, (SELECT MIN(`io_stock_qty`) FROM `{$g5['g5_shop_item_option_table']}` WHERE `it_id` = a.`it_id` GROUP BY `it_id`) 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); From d97f27f2fad7db258a4964f0d9fc52fa5803b0a0 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Thu, 30 Dec 2021 08:37:12 +0000 Subject: [PATCH 11/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EC=83=81=ED=92=88=20=EC=9E=AC=EA=B3=A0=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20out=5Fof=5Fstock=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 8e395652e..cd919fd9e 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -19,7 +19,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { $row['ca_adult_parent4']); // 4depth 성인인증 } -$sql =" SELECT a.*, (SELECT MIN(`io_stock_qty`) FROM `{$g5['g5_shop_item_option_table']}` WHERE `it_id` = a.`it_id` GROUP BY `it_id`) AS in_stock +$sql =" SELECT a.*, IFNULL((SELECT MIN(`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); @@ -49,7 +49,9 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) { } $stock = "in_stock"; - if($row['in_stock'] != null) { + if($row['it_stock_qty'] <= 0) { + $stock = "out_of_stock"; + } else { if($row['in_stock'] <= 0) $stock = "out_of_stock"; } From 8fbbae488beccdc17207ae935a6a39bd7a424fae Mon Sep 17 00:00:00 2001 From: loves2tu Date: Fri, 31 Dec 2021 06:03:15 +0000 Subject: [PATCH 12/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EC=83=81=ED=92=88=EC=9D=98=20=EC=9E=AC=EA=B3=A0=20&=20?= =?UTF-8?q?=EC=83=81=ED=92=88=EC=98=B5=EC=85=98=EC=9D=98=20=EC=9E=AC?= =?UTF-8?q?=EA=B3=A0=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=9E=AC=EA=B3=A0?= =?UTF-8?q?=EA=B0=92=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index cd919fd9e..f7c5efa90 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -50,7 +50,11 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) { $stock = "in_stock"; if($row['it_stock_qty'] <= 0) { - $stock = "out_of_stock"; + if($row['in_stock'] > 0) { + $stock = "in_stock"; + } else { + $stock = "out_of_stock"; + } } else { if($row['in_stock'] <= 0) $stock = "out_of_stock"; } From 754b25191f5c10829ef9cd3a15ebfcd64a28194d Mon Sep 17 00:00:00 2001 From: loves2tu Date: Fri, 31 Dec 2021 06:18:08 +0000 Subject: [PATCH 13/18] =?UTF-8?q?Revert=20"=EA=B5=AC=EA=B8=80=20=ED=8C=90?= =?UTF-8?q?=EB=A7=A4=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8fbbae488beccdc17207ae935a6a39bd7a424fae. --- shop/price/google_feed.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index f7c5efa90..cd919fd9e 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -50,11 +50,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) { $stock = "in_stock"; if($row['it_stock_qty'] <= 0) { - if($row['in_stock'] > 0) { - $stock = "in_stock"; - } else { - $stock = "out_of_stock"; - } + $stock = "out_of_stock"; } else { if($row['in_stock'] <= 0) $stock = "out_of_stock"; } From 42270398111300ab18e2e478c6c0d4be29eccffc Mon Sep 17 00:00:00 2001 From: loves2tu Date: Fri, 31 Dec 2021 06:32:14 +0000 Subject: [PATCH 14/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EB=AA=A8=EB=93=A0=20=EC=98=B5=EC=85=98=EC=9E=AC=EA=B3=A0=20?= =?UTF-8?q?=EC=A4=91=201=EC=9D=B4=EC=83=81=EC=9D=98=20=EC=9E=AC=EA=B3=A0?= =?UTF-8?q?=EA=B0=80=20=EC=A1=B4=EC=9E=AC=ED=95=98=EB=8A=94=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20:=20in=5Fstock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index cd919fd9e..7f238b763 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -19,7 +19,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { $row['ca_adult_parent4']); // 4depth 성인인증 } -$sql =" SELECT a.*, IFNULL((SELECT MIN(`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 +$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); From ebdd3b43903b2b810ff2b7c0f38e986899653c1a Mon Sep 17 00:00:00 2001 From: loves2tu Date: Fri, 31 Dec 2021 06:44:44 +0000 Subject: [PATCH 15/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20avail?= =?UTF-8?q?ability,=20adult=20=EB=84=A4=EC=9E=84=EC=8A=A4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4(g)=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 7f238b763..642a97e2a 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -62,7 +62,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) { $item->addChild("description", $it_basic); $item->addChild("link", $it_link); $item->addChild("g:g:image_link", $it_image); - $item->addChild("availability", $stock); + $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'])); @@ -83,7 +83,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) { } } - $item->addChild("adult", $adult); + $item->addChild("g:g:adult", $adult); } header('Content-type: text/xml'); From 2fc24b0746c5e82871f10c8747ca3024dc3f0c85 Mon Sep 17 00:00:00 2001 From: seeoya Date: Mon, 3 Jan 2022 03:16:32 +0000 Subject: [PATCH 16/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=ED=95=AD?= =?UTF-8?q?=EB=AA=A9=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/price.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/adm/shop_admin/price.php b/adm/shop_admin/price.php index 067852bba..6dfb45c34 100644 --- a/adm/shop_admin/price.php +++ b/adm/shop_admin/price.php @@ -33,7 +33,7 @@ $pg_anchor = '

    사이트 명을 클릭하시면 해당 사이트로 이동합니다.

    -
    네이버 지식쇼핑
    +
    네이버쇼핑
    + +
    구글 쇼핑
    +
    + +
    +
    Feed 설명
    +
    +
      +
    • 판매국가 대한민국, 언어 한국어 설정 기준입니다.
    • +
    • 기본 피드 이름 : 쇼핑몰피드
    • +
    • 상품 설명 : it_basic (상품기본설명을 필수 입력해주세요. HTML 태그는 자동 제거됩니다.)
    • +
    +
    +
    다음 쇼핑하우
      From 57fc5353f1fefd78e772d6e95bff44d8421bb454 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Tue, 4 Jan 2022 06:12:21 +0000 Subject: [PATCH 17/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=9A=A9=20=ED=94=BC=EB=93=9C=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/feedtest.xml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 shop/price/feedtest.xml diff --git a/shop/price/feedtest.xml b/shop/price/feedtest.xml deleted file mode 100644 index e955cdd2c..000000000 --- a/shop/price/feedtest.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From d9307915040ab0a556f02c88be8267b4673713fb Mon Sep 17 00:00:00 2001 From: loves2tu Date: Tue, 4 Jan 2022 07:41:39 +0000 Subject: [PATCH 18/18] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=EC=87=BC=ED=95=91=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=A6=84,=20=ED=8C=8C=EC=9D=BC=20URL=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/price.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adm/shop_admin/price.php b/adm/shop_admin/price.php index 6dfb45c34..fdc29ea4e 100644 --- a/adm/shop_admin/price.php +++ b/adm/shop_admin/price.php @@ -46,8 +46,8 @@ $pg_anchor = '