質問 > フロント機能 > 【2.13.0】新着商品プラグインの特定カテゴリ非表示 |
フロント機能
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
k14lost |
投稿日時: 2013/11/1 13:40
対応状況: −−−
|
新米 登録日: 2013/5/2 居住地: 投稿: 9 |
【2.13.0】新着商品プラグインの特定カテゴリ非表示 ・EC-CUBE 2.13.0
・PHP PHP 5.3.11-dev ・DB MySQL 5.5.21 いつもお世話になります。 プラグイン「新着商品ブロック」で、 特定カテゴリの非表示をしたいのですが、 中々うまくきません。 それ以外のサイドバー商品カテゴリ・商品一覧では 特定カテゴリの非表示がうまくいきました。 以下ソースです。 ----------------- <?php // {{{ requires require_once CLASS_REALDIR . 'pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php'; /** * 新着商品ブロックのブロッククラス */ class LC_Page_FrontParts_Bloc_NewItems extends LC_Page_FrontParts_Bloc { /** * 初期化する. * * @return void */ function init() { parent::init(); } /** * プロセス. * * @return void */ function process() { $this->action(); $this->sendResponse(); } /** * Page のアクション. * * @return void */ function action() { //商品情報取得 $this->arrNewItems = $this->lfGetNewitems(); } /** * デストラクタ. * * @return void */ function destroy() { parent::destroy(); } /** * 新着商品の情報を取得 * * @return array * @setcookie array */ function lfGetNewitems(){ $objQuery =& SC_Query_Ex::getSingletonInstance(); $objProduct = new SC_Product_Ex(); // プラグイン情報を取得. $plugin = SC_Plugin_Util_Ex::getPluginByPluginCode("NewItems"); //表示条件 $disp_rule = is_numeric($plugin['free_field1']) ? $plugin['free_field1'] : 0; //表示件数 $disp_count = unserialize($plugin['free_field2']); //表示ステータス $product_status = $plugin['free_field3']; //デバイスフラグ $disp_device == SC_Display_Ex::detectDevice(); // 新着商品情報取得 $col = 'product_id'; $table = 'dtb_products'; $where = 'status = 1 and del_flg = 0'; if($product_status){ $arrStatus = unserialize($product_status); if(is_array( $arrStatus )){ $strstatus = ''; foreach( $arrStatus as $status ){ if( $strstatus ) $strstatus .= ','; $strstatus .= $status; } $where .= ' ' . 'AND product_id IN (' . ' SELECT product_id FROM dtb_product_status WHERE product_status_id IN (' . $strstatus . ')' . ')'; } } switch($disp_rule) { case 1://登録日順 $objQuery->setOrder('create_date desc'); break; case 2://更新日順 $objQuery->setOrder('update_date desc'); break; } if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_PC ) { $objQuery->setLimit($disp_count[10]); }elseif(SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE){ $objQuery->setLimit($disp_count[1]); }elseif(SC_Display_Ex::detectDevice() == DEVICE_TYPE_SMARTPHONE ){ $objQuery->setLimit($disp_count[2]); } $arrProducts = $objQuery->select($col, $table, $where); $objQuery =& SC_Query_Ex::getSingletonInstance(); if (count($arrProducts) > 0) { $arrProductId = array(); foreach ($arrProducts as $key => $val) { $arrProductId[] = $val['product_id']; } // category_id=7 を含む商品情報を配列から削除 foreach($arrProducts as $arrProduct){ $arrCategoryId = SC_Helper_DB_Ex::sfGetCategoryId($arrProduct['product_id']); if(in_array(7, $arrCategoryId)){ unset($arrProducts[$arrProduct['product_id']]); } } // 商品詳細情報取得 $arrTmp = $objProduct->getListByProductIds($objQuery, $arrProductId); foreach ($arrTmp as $key => $arrRow) { $_row = $arrRow; $arrProductList[] = $_row; } } return $arrProductList; } } ?> ----------------- プラグイン対応バージョンが2.12系でしたが、 現在正常に動いております。 どなたかご教授をお願い致します。 |
フラット表示 | 前のトピック | 次のトピック |
題名 | 投稿者 | 日時 |
---|---|---|
» 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | k14lost | 2013/11/1 13:40 |
Re: 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | namahage | 2013/11/1 15:16 |
Re: 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | k14lost | 2013/11/1 15:36 |
Re: 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | namahage | 2013/11/1 17:28 |
Re: 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | namahage | 2013/11/1 17:45 |
Re: 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | k14lost | 2013/11/5 9:51 |
Re: 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | D-18 | 2016/2/19 1:03 |
Re: 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | sumida | 2013/11/1 16:31 |
Re: 【2.13.0】新着商品プラグインの特定カテゴリ非表示 | k14lost | 2013/11/1 17:00 |