質問 > フロント機能 > 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる) |
フロント機能
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
fukap |
投稿日時: 2012/2/14 9:19
対応状況: −−−
|
仙人 登録日: 2009/7/7 居住地: 滋賀県 投稿: 907 |
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる) あ、ホントですね。うっかり見落としてましたw
んじゃこれでどうかな?
|
maruuuuuun |
投稿日時: 2012/2/14 10:17
対応状況: −−−
|
半人前 登録日: 2012/2/12 居住地: 投稿: 22 |
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる) 何度もお返事ありがとうございます。
<!--{$i.price|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}--> で記載してみても結果は同じ0円になってしまいました…。 また <!--{$arrRanking.price|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}--> で試してみても同じ結果でした。 ちなみにランキング設置にあたり、操作したデータは ?/frontparts/bloc/ranking.php ?/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_ProductFlag.php ?/data/class_extends/page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_ProductFlag_Ex.php ?データベース 操作参考:http://100yenbento.me/?p=544 と、なります。 内、ranking.phpのデータは先日こちらで記載させていただいたもので他の2つも下記へ記載させていただきます。 ---------------------------------------------------------------------------------------------------------------------- ■LC_Page_FrontParts_Bloc_Ranking.php <?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. */ // {{{ requires require_once(CLASS_REALDIR . "pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php"); /** * ランキング のページクラス. */ class LC_Page_FrontParts_Bloc_Ranking extends LC_Page_FrontParts_Bloc { /** * Page を初期化する. * * @return void */ function init() { parent::init(); $bloc_file = 'ranking.tpl'; $this->setTplMainpage($bloc_file); } /** * Page のプロセス. * * @return void */ function process() { if (defined("MOBILE_SITE") && MOBILE_SITE) { $objView = new SC_MobileView(); } else { $objView = new SC_SiteView(); } $objSiteInfo = $objView->objSiteInfo; // 基本情報を渡す $objSiteInfo = SC_Helper_DB_Ex::sfGetBasisData(); // ランキング表示 2009.05.08追加 $this->arrRanking = $this->lfGetRanking(); $objView->assignobj($this); $objView->display($this->tpl_mainpage); //おすすめ商品表示 //$this->arrBestProducts = $this->lfGetRanking(); //$objView->assignobj($this); //objView->display($this->tpl_mainpage); } /** * モバイルページを初期化する. * * @return void */ function mobileInit() { $this->tpl_mainpage = MOBILE_TEMPLATE_DIR . "frontparts/" . BLOC_DIR . 'ranking.tpl'; } /** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $this->process(); } /** * デストラクタ. * * @return void */ function destroy() { parent::destroy(); } // ランキング検索 function lfGetRanking(){ $objQuery = new SC_Query(); $col = "T1.product_id, T1.product_name as name, T3.main_list_image, COUNT(*) as order_count"; $from = "dtb_order_detail AS T1 INNER JOIN dtb_order AS T2 ON T1.order_id = T2.order_id INNER JOIN dtb_products AS T3 ON T1.product_id = T3.product_id"; $objQuery->setwhere("T3.status = 1"); $objQuery->setGroupBy("T1.product_id, T1.product_name, T3.main_list_image"); $objQuery->setOrder("order_count DESC"); $objQuery->setLimit(5); return $objQuery->select($col, $from); } } ?> ---------------------------------------------------------------------------------------------------------------------- ■LC_Page_FrontParts_Bloc_Ranking_Ex.php <?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. */ // {{{ requires require_once(CLASS_REALDIR . "pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Ranking.php"); /** * ランキング のページクラス(拡張). * * LC_Page_FrontParts_Bloc_Ranking をカスタマイズする場合はこのクラスを編集する. */ class LC_Page_FrontParts_Bloc_Ranking_Ex extends LC_Page_FrontParts_Bloc_Ranking { /** * Page を初期化する. * * @return void */ function init() { parent::init(); } /** * Page のプロセス. * * @return void */ function process() { parent::process(); } /** * デストラクタ. * * @return void */ function destroy() { parent::destroy(); } } ?> ---------------------------------------------------------------------------------------------------------------------- さっぱりな状況で、混沌としています。 どうかお力添えをよろしく御願いたします。 |
PWS |
投稿日時: 2012/2/14 10:32
対応状況: −−−
|
一人前 登録日: 2012/1/23 居住地: Itami Hyogo 投稿: 141 |
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる) 横からしゃしゃり出てすみません。
やはり$arrRankingの中身をdumpしてみたほうがよさそうですね。 <!--{$arrRanking|var_dump}--> の中身が出ればはっきりすると思います。 |
seasoft |
投稿日時: 2012/2/14 11:29
対応状況: −−−
|
神 登録日: 2008/6/4 居住地: 投稿: 7367 |
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる) 「var_dump」は「@var_dump」とすべき予感。
下記も参考になると良いのですが・・・ http://seasoft.jp1.cx/ec/tips/smarty
|
PWS |
投稿日時: 2012/2/14 11:34
対応状況: −−−
|
一人前 登録日: 2012/1/23 居住地: Itami Hyogo 投稿: 141 |
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる)
|
maruuuuuun |
投稿日時: 2012/2/14 12:06
対応状況: −−−
|
半人前 登録日: 2012/2/12 居住地: 投稿: 22 |
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる) 皆さん、本当にありがとうございます。
入力すると array(4) { ["product_id"]=> string(2) "15" ["name"]=> string(39) "プリントシフォンワンピース" ["main_list_image"]=> string(26) "02131618_4f38b95b06d93.jpg" ["order_count"]=> string(1) "1" } Array円 と出ました。 PHPの事がよく判らないのですが…価格のところだけ「Array」というのは可笑しい感じがします。 これで何か分かりますでしょうか? |
PWS |
投稿日時: 2012/2/14 12:10
対応状況: −−−
|
一人前 登録日: 2012/1/23 居住地: Itami Hyogo 投稿: 141 |
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる) おろ、いつのまにやらsql文から
, T1.price が抜けてますね? |
maruuuuuun |
投稿日時: 2012/2/14 12:56
対応状況: 解決済
|
半人前 登録日: 2012/2/12 居住地: 投稿: 22 |
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる) ついに出来ました!
ネットの情報を元に色々肉付けしていったので、どこかで記述が抜けていたのですね。 みなさん、この度は本当にありがとうございました!!! 感謝の気持ちでいっぱいです♪ |
« 1 (2) |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |