バージョン選択

フォーラム

メニュー

オンライン状況

67 人のユーザが現在オンラインです。 (57 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 67
もっと...

サイト内検索

質問 > フロント機能 > 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる)

フロント機能

新規スレッドを追加する

スレッド表示 | 古いものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
maruuuuuun
投稿日時: 2012/2/14 12:56
対応状況: 解決済
半人前
登録日: 2012/2/12
居住地:
投稿: 22
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる)
ついに出来ました!

ネットの情報を元に色々肉付けしていったので、どこかで記述が抜けていたのですね。

みなさん、この度は本当にありがとうございました!!!

感謝の気持ちでいっぱいです♪
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: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 11:34
対応状況: −−−
一人前
登録日: 2012/1/23
居住地: Itami Hyogo
投稿: 141
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる)
フォローありがとうございます。

こちらも参考までに
http://creazy.net/2008/06/smarty_how_to_dump.html
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


----------------
Seasoft
こちらでの投稿は、アイディア程度に留めさせていただいております。
個別案件の作業は有償で承っております。お気軽にご相談ください。

PWS
投稿日時: 2012/2/14 10:32
対応状況: −−−
一人前
登録日: 2012/1/23
居住地: Itami Hyogo
投稿: 141
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる)
横からしゃしゃり出てすみません。

やはり$arrRankingの中身をdumpしてみたほうがよさそうですね。

<!--{$arrRanking|var_dump}-->

の中身が出ればはっきりすると思います。
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();
}
}
?>

----------------------------------------------------------------------------------------------------------------------


さっぱりな状況で、混沌としています。
どうかお力添えをよろしく御願いたします。
fukap
投稿日時: 2012/2/14 9:19
対応状況: −−−
仙人
登録日: 2009/7/7
居住地: 滋賀県
投稿: 907
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる)
あ、ホントですね。うっかり見落としてましたw
んじゃこれでどうかな?

<!--{$i.price|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
PWS
投稿日時: 2012/2/14 8:56
対応状況: −−−
一人前
登録日: 2012/1/23
居住地: Itami Hyogo
投稿: 141
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる)
横からちょこっとだけ

PHP側で$arrProductは出てきてないように見えますね〜
fukap
投稿日時: 2012/2/14 8:45
対応状況: −−−
仙人
登録日: 2009/7/7
居住地: 滋賀県
投稿: 907
Re: 2.11.4でのトップページのランキング表示について(キャッシュが残る、価格が0円表示になる)
dtb_order_detail を T1 としているので、T1.price で取れそうなんですけどね。
修正すべきテンプレートが別にあるということはありませんか?

また、テンプレートのどこかに、
var_dump($arrProducts);
を記述してみて、出力された文字列の中に目当ての情報があるか
見てみると良いと思います。

(1) 2 »
スレッド表示 | 古いものから 前のトピック | 次のトピック | トップ


 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は89,025名です
総投稿数は110,020件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1646
8
red
1570
9
mcontact
1296
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.