Source for file LC_Page_Rss_Products.php
Documentation is available at LC_Page_Rss_Products.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(CLASS_PATH . "pages/LC_Page.php");
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Rss_Products.php 18735 2010-06-22 08:53:31Z nanasess $
$arrSiteInfo = $objSiteInfo->data;
$product_id = $_GET['product_id'];
if(($product_id != "" and is_numeric($product_id)) or $mode == "all"){
foreach($arrProduct as $key => $val){
$arrProduct[$key]["price02"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price02"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
(file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_list_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
$arrProduct[$key]["main_list_image"] = $dir . $arrProduct[$key]["main_list_image"];
(file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
$arrProduct[$key]["main_image"] = $dir . $arrProduct[$key]["main_image"];
(file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_large_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
$arrProduct[$key]["main_large_image"] = $dir . $arrProduct[$key]["main_large_image"];
$arrProduct[$key]["point"] = SC_Utils_Ex::sfPrePoint($arrProduct[$key]["price02"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]);
$arrProduct[$key]["stock_unlimited"] = ($arrProduct[$key]["stock_unlimited"] == 1) ? "在庫無制限" : NULL;
}elseif($mode == "list"){
$arrProduct = $objQuery->getAll("SELECT product_id, name AS product_name FROM dtb_products");
foreach($arrProduct as $key => $val){
$arrProduct[$key]["price01_max"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price01_max"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
$arrProduct[$key]["price01_min"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price01_min"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
$arrProduct[$key]["price02_max"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price02_max"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
$arrProduct[$key]["price02_min"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price02_min"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
(file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_list_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
$arrProduct[$key]["main_list_image"] = $dir . $arrProduct[$key]["main_list_image"];
(file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
$arrProduct[$key]["main_image"] = $dir . $arrProduct[$key]["main_image"];
(file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_large_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
$arrProduct[$key]["main_large_image"] = $dir . $arrProduct[$key]["main_large_image"];
$arrProduct[$key]["point_max"] = SC_Utils_Ex::sfPrePoint($arrProduct[$key]["price02_max"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]);
$arrProduct[$key]["point_min"] = SC_Utils_Ex::sfPrePoint($arrProduct[$key]["price02_min"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]);
$this->arrProduct = $arrProduct;
if(is_array(SC_Utils_Ex::sfswaparray($arrProduct))){
$this->arrProductKeys = array_keys(SC_Utils_Ex::sfswaparray($arrProduct));
$this->arrSiteInfo = $arrSiteInfo;
$objView->assignobj($this);
//XMLテキスト(これがないと正常にRSSとして認識してくれないツールがあるため)
header("Content-type: application/xml");
* @param SC_Query $objQuery DB操作クラス
* @param integer $product_id 商品ID
* @return array $arrProduct 取得結果を配列で返す
$sql .= " prod.product_id ";
$sql .= " ,prod.name AS product_name ";
$sql .= " ,prod.category_id ";
$sql .= " ,prod.point_rate ";
$sql .= " ,prod.comment3 ";
$sql .= " ,prod.main_list_comment ";
$sql .= " ,prod.main_list_image ";
$sql .= " ,prod.main_comment ";
$sql .= " ,prod.main_image ";
$sql .= " ,prod.main_large_image ";
$sql .= " ,cls.product_code ";
$sql .= " ,cls.price01 ";
$sql .= " ,cls.price02 ";
$sql .= " ,cls.stock_unlimited ";
$sql .= " ,cls.classcategory_id1 ";
$sql .= " ,cls.classcategory_id2 ";
$sql .= " ,(SELECT name FROM dtb_classcategory AS clscat WHERE clscat.classcategory_id = cls.classcategory_id1) AS classcategory_name1 ";
$sql .= " ,(SELECT name FROM dtb_classcategory AS clscat WHERE clscat.classcategory_id = cls.classcategory_id2) AS classcategory_name2 ";
$sql .= " ,(SELECT category_name FROM dtb_category AS cat WHERE cat.category_id = prod.category_id) AS category_name";
$sql .= " ,prod.update_date ";
$sql .= " FROM dtb_products AS prod, dtb_products_class AS cls";
$sql .= " WHERE prod.product_id = cls.product_id AND prod.del_flg = 0 AND prod.status = 1";
if($product_id != "all"){
$sql .= " AND prod.product_id = ?";
$arrval = array($product_id);
$sql .= " ORDER BY prod.product_id, cls.classcategory_id1, cls.classcategory_id2";
$arrProduct = $objQuery->getAll($sql, $arrval);
* 商品情報を取得する(vw_products_allclass使用)
* @param SC_Query $objQuery DB操作クラス
* @return array $arrProduct 取得結果を配列で返す
,(SELECT category_name FROM dtb_category AS cat WHERE cat.category_id = allcls.category_id) AS category_name
,(SELECT main_large_image FROM dtb_products AS prod WHERE prod.product_id = allcls.product_id) AS main_large_image
FROM vw_products_allclass as allcls
WHERE allcls.del_flg = 0 AND allcls.status = 1";
$sql .= " ORDER BY allcls.product_id";
$arrProduct = $objQuery->getAll($sql);
Documentation generated on Fri, 24 Feb 2012 13:59:46 +0900 by Seasoft
|