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-2011 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_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Rss_Products.php 21256 2011-09-25 04:15:51Z Seasoft $
$this->tpl_mainpage = "rss/products.tpl";
$objView = new SC_SiteView_Ex();
$this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
if ( isset ($_GET['product_id']) && $_GET['product_id'] != '' && is_numeric($_GET['product_id']) ) {
$product_id = $_GET['product_id'];
$mode = $this->getMode();
if ( $product_id != '' && is_numeric($product_id) ) {
if ( $product_id != '' && is_numeric($product_id) ) {
$this->arrProduct = $arrProduct;
$objView->assignobj($this);
//XMLテキスト(これがないと正常にRSSとして認識してくれないツールがあるため)
header("Content-type: application/xml");
$objView->display($this->tpl_mainpage, true);
* lfGetProductsDetailData.
* @param str $product_id 商品ID
* @return array $arrProduct 商品情報の配列を返す
$objQuery = SC_Query_Ex::getSingletonInstance();
foreach ($arrProduct as $key => $val) {
$arrProduct[$key]['price02'] = SC_Helper_DB_Ex::sfCalcIncTax($arrProduct[$key]['price02']);
if ( file_exists(IMAGE_SAVE_REALDIR . $arrProduct[$key]['main_list_image']) ) {
$dir = IMAGE_SAVE_RSS_URL;
$dir = IMAGE_TEMP_RSS_URL;
$arrProduct[$key]['main_list_image'] = $dir . $arrProduct[$key]['main_list_image'];
if ( file_exists(IMAGE_SAVE_REALDIR . $arrProduct[$key]['main_image']) ){
$dir = IMAGE_SAVE_RSS_URL;
$dir = IMAGE_TEMP_RSS_URL;
$arrProduct[$key]['main_image'] = $dir . $arrProduct[$key]['main_image'];
if ( file_exists(IMAGE_SAVE_REALDIR . $arrProduct[$key]['main_large_image']) ) {
$dir = IMAGE_SAVE_RSS_URL;
$dir = IMAGE_TEMP_RSS_URL;
$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']
if ( $arrProduct[$key]['stock_unlimited'] == 1 ) {
$arrProduct[$key]['stock_unlimited'] = '在庫無制限';
$arrProduct[$key]['stock_unlimited'] = NULL;
* @return array $arrProduct 商品情報の配列を返す
$objQuery = SC_Query_Ex::getSingletonInstance();
$arrProduct = $objQuery->getAll('SELECT product_id, name AS product_name FROM dtb_products');
* @return array $arrProduct 商品情報の配列を返す
$objQuery = SC_Query_Ex::getSingletonInstance();
foreach ($arrProduct as $key => $val) {
$arrProduct[$key]['price02_max'] = SC_Helper_DB_Ex::sfCalcIncTax($arrProduct[$key]['price02_max']);
$arrProduct[$key]['price02_min'] = SC_Helper_DB_Ex::sfCalcIncTax($arrProduct[$key]['price02_min']);
if ( file_exists(IMAGE_SAVE_REALDIR . $arrProduct[$key]['main_list_image']) ) {
$dir = IMAGE_SAVE_RSS_URL;
$dir = IMAGE_TEMP_RSS_URL;
$arrProduct[$key]['main_list_image'] = $dir . $arrProduct[$key]['main_list_image'];
if ( file_exists(IMAGE_SAVE_REALDIR . $arrProduct[$key]['main_image']) ) {
$dir = IMAGE_SAVE_RSS_URL;
$dir = IMAGE_TEMP_RSS_URL;
$arrProduct[$key]['main_image'] = $dir . $arrProduct[$key]['main_image'];
if ( file_exists(IMAGE_SAVE_REALDIR . $arrProduct[$key]['main_large_image']) ) {
$dir = IMAGE_SAVE_RSS_URL;
$dir = IMAGE_TEMP_RSS_URL;
$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']
$arrProduct[$key]['point_min'] = SC_Utils_Ex::sfPrePoint(
$arrProduct[$key]['price02_min'],
$arrProduct[$key]['point_rate']
* @param SC_Query $objQuery DB操作クラス
* @param integer $product_id 商品ID
* @return array $arrProduct 取得結果を配列で返す
$objProduct = new SC_Product_Ex();
if ($product_id == 'all') {
$objQuery->setOrder('product_id');
$arrProductLsit = $objProduct->lists($objQuery);
$arrProductLsit = $objProduct->getListByProductIds($objQuery, $product_id);
foreach( $arrProductLsit as $key => $val ) {
$sql .= ' T1.category_id,';
$sql .= ' T1.rank AS product_rank,';
$sql .= ' T2.rank AS category_rank';
$sql .= ' dtb_product_categories AS T1';
$sql .= ' dtb_category AS T2';
$sql .= ' T1.category_id = T2.category_id';
$sql .= ' product_id = ?';
$arrCategory = $objQuery->getAll($sql, array($val['product_id']));
if ( !empty($arrCategory) ) {
$arrProduct[$key] = array_merge($val, $arrCategory[0]);
* 商品情報を取得する(vw_products_allclass使用)
* @param SC_Query $objQuery DB操作クラス
* @return array $arrProduct 取得結果を配列で返す
$objQuery->setOrder('product_id');
$objProduct = new SC_Product_Ex();
$arrProductLsit = $objProduct->lists($objQuery);
foreach( $arrProductLsit as $key => $val ) {
$sql .= ' T1.category_id,';
$sql .= ' T1.rank AS product_rank,';
$sql .= ' T2.rank AS category_rank';
$sql .= ' dtb_product_categories AS T1';
$sql .= ' dtb_category AS T2';
$sql .= ' T1.category_id = T2.category_id';
$sql .= ' product_id = ?';
$arrCategory = $objQuery->getAll($sql, array($val['product_id']));
if ( !empty($arrCategory) ) {
$arrProduct[$key] = array_merge($val, $arrCategory[0]);
* @param array $arrProduct 商品データ配列
* @return array $arrProductKeys 商品情報のkey配列を返す
$arrProductKeys = array();
$arrProduct = SC_Utils_Ex::sfSwapArray($arrProduct);
Documentation generated on Fri, 24 Feb 2012 14:02:15 +0900 by Seasoft
|