バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > フロント機能 > 2.11.4|ランキングブロックでの通常価格表示について

フロント機能

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
maruuuuuun
投稿日時: 2013/1/23 1:04
対応状況: −−−
半人前
登録日: 2012/2/12
居住地:
投稿: 22
2.11.4|ランキングブロックでの通常価格表示について
いつもお世話になっております。

2.11.4系でランキングを表示させる事までは成功したのですが、そこのブロックでの通常価格表示について困惑しております。

ランキングにはおすすめ商品や新着商品のように

<!--{$arrProduct.price02_min|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->

と「price02」や「price01」と分ける記述がなく、どうやって表示したら良いのかわかりません。

またデータベースの操作も必要なのかな?とも思いますが、何分phpやデータベース事はあまり分からず、どうにもならない状態です。

どなたかご教授下さいますと幸いです。

個人的には「LC_Page_FrontParts_Bloc_Ranking.php」内の

-----------↓↓↓------------

// ランキング検索
function lfGetRanking(){
$objQuery = new SC_Query();

$col = "T1.product_id, T1.product_name as name, T3.main_list_image, COUNT(*) as order_count, T1.price";
$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 AND T3.del_flg = 0");
$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);
}

-----------↑↑↑------------

ここなんかが怪しいかと感じます。



なお制作したファイルは下記のようになります。



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

■ranking.php

-----------↓↓↓------------

<?php
require_once(CLASS_EX_REALDIR . "page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Ranking_Ex.php");

$objPage = new LC_Page_FrontParts_BLoc_Ranking_Ex();
register_shutdown_function(array($objPage, "destroy"));
$objPage->init();
$objPage->process();
?>

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

■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, T1.price";
$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 AND T3.del_flg = 0");
$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();
}
}
?>

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

■ranking.tpl(ブロックテンプレート内)

-----------↓↓↓------------

<!--{if count($arrRanking) > 0}-->

<div class="bloc_outer clearfix">
<div id="recommend_area">
<h2><img src="<!--{$TPL_URLPATH}-->img/title/rankitem_title.gif" alt="ランキング" title="ランキング" /></h2>
<div class="bloc_body clearfix">
<!--{foreach from=$arrRanking key=myId item=i}-->
<div class="itembox_block">
<dl class="itembox">
<dt class="rank_number">
<!--{assign var=rank value=$myId+1}-->
<img src="<!--{$TPL_URLPATH}-->img/rank<!--{$rank}-->.gif" alt="ランキング" /> </dt>
<dt> <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$i.product_id}-->"><img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/<!--{$i.main_list_image}-->" width="130px" alt="<!--{$i.name}-->"></a> </dt>
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$i.product_id}-->">
<dt>
<!--{assign var=rank value=$myId+1}-->
<!--{$i.name}-->
</dt>
<dd>
<!--{$i.price|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
円</dd>
</a>
</dl>
</div>
<!--{/foreach}-->
</div>
</div>
</div>
<!--{/if}-->

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


よろしくお願いいたします。
フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
 » 2.11.4|ランキングブロックでの通常価格表示について maruuuuuun 2013/1/23 1:04
     Re: 2.11.4|ランキングブロックでの通常価格表示について dkazuto 2013/1/23 2:39
       Re: 2.11.4|ランキングブロックでの通常価格表示について maruuuuuun 2013/1/23 10:02

 



ログイン


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

統計情報

総メンバー数は88,885名です
総投稿数は110,000件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2313
5
umebius
2085
6
yuh
1819
7
h_tanaka
1646
8
red
1570
9
mcontact
1295
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.