バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > フロント機能 > 2.11.1系で、新着商品を表示させたい。

フロント機能

新規スレッドを追加する

| 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
Leon
投稿日時: 2011/6/23 17:47
対応状況: 確認中
半人前
登録日: 2011/4/13
居住地:
投稿: 16
2.11.1系で、新着商品を表示させたい。
いろんなスレッドを見てきましたが、どちらも、2.4系なので、2.11系を使ってみたら、エラーが出ました。

どこか間違ってますか?
アドバイスを教えてください。

EC-CUBEバージョン 2.11.1
PHPバージョン PHP 5.1.6
DBバージョン MySQL 5.0.77

↓プログラム内容↓

<!--{*
* 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.
*}-->
<!--▼新着商品ここから-->
<!--{if count($arrFlagProducts) > 0}-->

<h3>新着商品</h3>

<!--{section name=cnt loop=$arrFlagProducts step=2}-->

<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrFlagProducts[cnt].product_id}-->">
<!--{if $arrFlagProducts[cnt].main_list_image != ""}-->
<!--{assign var=image_path value="`$arrFlagProducts[cnt].main_list_image`"}-->
<!--{else}-->
<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
<!--{/if}-->
<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$arrFlagProducts[cnt].main_image|sfRmDupSlash}-->&width=65&height=65" alt="<!--{$arrFlagProducts[cnt].name|escape}-->" />
</a>

<!--{assign var=price01 value=`$arrFlagProducts[cnt].price01_min`}-->
<!--{assign var=price02 value=`$arrFlagProducts[cnt].price02_min`}-->
<h4><a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrFlagProducts[cnt].product_id}-->"><!--{$arrFlagProducts[cnt].name|escape}--></a></h4>

価格<span class="font-size-2minus">(税込)</span>:<em class="font-color-red">
<!--{if $price02 == ""}-->
<!--{$price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{else}-->
<!--{$price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{/if}-->円</em>

<span class="font-size-2minus"><!--{$arrFlagProducts[cnt].comment|escape|nl2br}--></span>

<!--{assign var=cnt2 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-1` }-->
<!--{if $arrFlagProducts[$cnt2]|count > 0}-->

<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrFlagProducts[$cnt2].product_id}-->">
<!--{if $arrFlagProducts[$cnt2].main_list_image != ""}-->
<!--{assign var=image_path value="`$arrFlagProducts[$cnt2].main_list_image`"}-->
<!--{else}-->
<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
<!--{/if}-->
<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$arrFlagProducts[$cnt2].main_image|sfRmDupSlash}-->&width=65&height=65" alt="<!--{$arrFlagProducts[$cnt2].name|escape}-->" />
</a>

<!--{assign var=price01 value=`$arrFlagProducts[$cnt2].price01_min`}-->
<!--{assign var=price02 value=`$arrFlagProducts[$cnt2].price02_min`}-->
<h4><a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrFlagProducts[$cnt2].product_id}-->"><!--{$arrFlagProducts[$cnt2].name|escape}--></a></h4>

価格<span class="font-size-2minus">(税込)</span>:<em class="font-color-red">
<!--{if $price02 == ""}-->
<!--{$price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{else}-->
<!--{$price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{/if}-->円</em>

<span class="font-size-2minus"><!--{$arrFlagProducts[$cnt2].comment|escape|nl2br}--></span>

<br class="clear" />

<!--{/if}-->

<!--{/section}-->

<!--{/if}-->
<!--▲新着商品情報ここまで-->


以上です。
fukap
投稿日時: 2011/6/23 17:58
対応状況: −−−
仙人
登録日: 2009/7/7
居住地: 滋賀県
投稿: 907
Re: 2.11.1系で、新着商品を表示させたい。
このコードをどこに張ったら、どんなエラーが出たのでしょうか。
またこのコードはどのスレッドを参考にされたものでしょうか。
vyu
投稿日時: 2011/6/24 14:18
対応状況: −−−
半人前
登録日: 2011/6/24
居住地:
投稿: 15
Re: 2.11.1系で、新着商品を表示させたい。
当方PHP初心者で、同様2.11で新着商品をトップページに表示させたく
下記のスレッドを参考にしましたが、できませんでした。

▼新入荷商品をブロックに表示したい
http://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=1276&forum=6


最終的に完成したブロック「product_flag.php」をトップページに追加したところ、エラーがでました。
デバッグモードで確認すると、
Failed opening required 'CLASS_EX_PATHpage_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_ProductFlag_Ex.php'
と表示されましたが、関係ありますでしょうか?
fukap
投稿日時: 2011/6/24 14:25
対応状況: −−−
仙人
登録日: 2009/7/7
居住地: 滋賀県
投稿: 907
Re: 2.11.1系で、新着商品を表示させたい。
/frontparts/bloc/product_flag.php で、require_once文 が以下のようになっていますか?(ドットが抜けてるとか)

require_once(CLASS_EX_PATH . "page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_ProductFlag_Ex.php");
vyu
投稿日時: 2011/6/24 15:50
対応状況: −−−
半人前
登録日: 2011/6/24
居住地:
投稿: 15
Re: 2.11.1系で、新着商品を表示させたい。
ご返答ありがとうございます。
確認したところ、ドットは抜けておらず、

require_once(CLASS_EX_PATH . "page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_ProductFlag_Ex.php");

となっておりました。
引き続き解決方法を模索中です。
nkta
投稿日時: 2011/6/24 15:53
対応状況: −−−
長老
登録日: 2011/5/20
居住地: 東京
投稿: 166
Re: 2.11.1系で、新着商品を表示させたい。
引用:

require_once(CLASS_EX_PATH . "page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_ProductFlag_Ex.php");

の直前でCLASS_EX_PATHをechoなりvar_dumpなりで出力してみて、
定数が正しく定義されてるかを確認されてみてはいかがでしょうか。
vyu
投稿日時: 2011/6/28 16:08
対応状況: −−−
半人前
登録日: 2011/6/24
居住地:
投稿: 15
Re: 2.11.1系で、新着商品を表示させたい。
直前で

echo (CLASS_EX_PATH);

とし確認してみたところ、CLASS_EX_PATHが出力されました。
定数が定義されていないようですが、この定数とはどこで定義すれば良いでしょうか。
fukap
投稿日時: 2011/6/28 16:23
対応状況: −−−
仙人
登録日: 2009/7/7
居住地: 滋賀県
投稿: 907
Re: 2.11.1系で、新着商品を表示させたい。
/frontparts/bloc/product_flag.php で、require_once文 を以下のようにしてみてください。

require_once(CLASS_EX_REALDIR . "page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_ProductFlag_Ex.php");

2.11系で、拡張クラスのディレクトリを取得する定数は、CLASS_EX_REALDIR のようです。
vyu
投稿日時: 2011/6/28 17:07
対応状況: −−−
半人前
登録日: 2011/6/24
居住地:
投稿: 15
Re: 2.11.1系で、新着商品を表示させたい。
教えていただいたrequire_once文にしたところ、解決しました。
ありがとうございます。

続いて CLASS_PATH に関しても同様のエラーが発生しましたが
CLASS_PATH を CLASS_REALDIR に変更し解決しました。

引き続き、修正過程で

引用:
Fatal error: Class 'SC_SiteInfo' not found in /※root※/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_ProductFlag.php on line 35


というエラーが発生しました。
LC_Page_FrontParts_Bloc_ProductFlag.phpの34・35行目付近は

引用:
// 基本情報を渡す
$objSiteInfo = new SC_SiteInfo();


です。何か解決のヒントになるようなことでも構いませんので
ご教授いただければ幸いです。


※2.11で、下記の実装を目指しています。
http://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=1276&forum=6
fukap
投稿日時: 2011/6/28 17:17
対応状況: −−−
仙人
登録日: 2009/7/7
居住地: 滋賀県
投稿: 907
Re: 2.11.1系で、新着商品を表示させたい。
新着商品表示は先日実装しました。2.4.4でしたが。

以下のようにするとどうですか?

LC_Page_FrontParts_Bloc_ProductFlag.phpの34・35行目付近 を以下に変更

// 基本情報を渡す
$objSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
(1) 2 3 4 ... 6 »
| 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

総メンバー数は88,858名です
総投稿数は109,996件です

投稿数ランキング

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
1294
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.