バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > その他 > 商品一覧ページ

その他

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
help
投稿日時: 2012/2/25 1:21
対応状況: −−−
半人前
登録日: 2012/2/23
居住地:
投稿: 16
商品一覧ページ
商品一覧を表形式で表示させたく、試みましたが1つの商品しか表の中には納まりません。どこがおかしいか教えていただけないでしょうか?
<!--▼商品-->
<form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;">
<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
<div class="list_area clearfix">
<a name="product<!--{$id|h}-->"></a>
<!--{if $smarty.foreach.arrProducts.first}-->
<table cellspacing="0" width="100%">
<tr><th>写真</th><th>商品名</th><th>サイズ(mm)</th><th>規格</th><th>税込価格</th><th>数量</th><th>カート</th></tr><!--{/if}-->
<tr><td>
<div class="listphoto">
<!--★画像★-->
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" class="over"><!--商品写真--><img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/<!--{$arrProduct.main_list_image|sfNoImageMainList|h}-->" alt="<!--{$arrProduct.name|h}-->" class="picture" /></a>
</div>
</td><td>
<!--★商品名★-->
<h3>
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->"><!--{$arrProduct.name|h}--></a>
</h3>
</td><td>
<!--★コメント★-->
<div class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></div>
</td><td>
<!--▼買い物かご-->
<input type="hidden" name="product_id" value="<!--{$id|h}-->" />
<input type="hidden" name="product_class_id" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" />

<div class="cart_area clearfix">
<!--{if $tpl_stock_find[$id]}-->
<!--{if $tpl_classcat_find1[$id]}-->
<div class="classlist">
<dl class="size01 clearfix">
<!--▼規格1-->
<dt><!--{$tpl_class_name1[$id]|h}-->:</dt>
<dd>
<select name="classcategory_id1" style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->">
<!--{html_options options=$arrClassCat1[$id] selected=$arrProduct.classcategory_id1}-->
</select>
<!--{if $arrErr.classcategory_id1 != ""}-->
<p class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</p>
<!--{/if}-->
</dd>
<!--▲規格1-->
</dl>
<!--{if $tpl_classcat_find2[$id]}-->
<dl class="size02 clearfix">
<!--▼規格2-->
<dt><!--{$tpl_class_name2[$id]|h}-->:</dt>
<dd>
<select name="classcategory_id2" style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->">
</select>
<!--{if $arrErr.classcategory_id2 != ""}-->
<p class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</p>
<!--{/if}-->
</dd>
<!--▲規格2-->
</dl>
<!--{/if}-->
</div>
<!--{/if}-->
</td><td>
<!--★価格★-->
<div class="pricebox sale_price">
<span class="price">
<span id="price02_default_<!--{$id}-->"><!--{strip}-->
<!--{if $arrProduct.price02_min == $arrProduct.price02_max}-->
<!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->
<!--{else}-->
<!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->〜<!--{$arrProduct.price02_max|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->
<!--{/if}-->
</span><span id="price02_dynamic_<!--{$id}-->"></span><!--{/strip}-->
円</span>
</div>
</td><td>
<div class="cartin clearfix">
<div class="quantity">
数量:<input type="text" name="quantity" class="box" value="<!--{$arrProduct.quantity|default:1|h}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" />
<!--{if $arrErr.quantity != ""}-->
<br /><span class="attention"><!--{$arrErr.quantity}--></span>
<!--{/if}-->
</div>
</td><td>
<div class="cartin_btn">
<!--★カゴに入れる★-->
<div id="cartbtn_default_<!--{$id}-->">
<input type="image" id="cart<!--{$id}-->" src="<!--{$TPL_URLPATH}-->img/button/btn_cartin.jpg" alt="カゴに入れる" onclick="fnInCart(this.form); return false;" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin_on.jpg', this);" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin.jpg', this);" />
</div>
<div class="attention" id="cartbtn_dynamic_<!--{$id}-->"></div>
</div>
</div>
<!--{else}-->
<div class="cartbtn attention">申し訳ございませんが、只今品切れ中です。</div>
<!--{/if}-->
</div>
<!--▲買い物かご-->
</div>
</div>
</td></tr>
</form></table>
<!--▲商品-->

分かりずらく申し訳ありません。
宜しくお願いします。


[EC-CUBE]     2.11.3
[レンタルサーバ] アルファテクニカル
[OS]       Linux
[PHP]      5.3.8
[データベース] MySQL 5.1.61
[WEBサーバ]   Apache
[ブラウザ]   IE8
fukap
投稿日時: 2012/2/25 11:41
対応状況: −−−
仙人
登録日: 2009/7/7
居住地: 滋賀県
投稿: 907
Re: 商品一覧ページ
コードを省略されていて不明な点がありますので、下記は参考程度にお願いします。

1商品だけでも表示されているところを見ると、
<!--{foreach from=$arrProducts item=arrProduct name=arrProducts}--> 〜 <!--{/foreach}-->
の中に記述されているコードなんだろうとは思います。

1商品だけしか表示されない理由として考えられそうなのが、このコードが
<!--{if $smarty.foreach.arrProducts.first}--> 〜 <!--{if}-->
の中に記述しているケースでしょうか。
これはループ(繰り返し処理)の1回目のみ 〜 を表示する、という意味ですので、
この中に書いてあれば、1商品しか表示されないはずです。

また書いていただいているコードがところどころおかしいように思います。
例えば、
<!--{if $smarty.foreach.arrProducts.first}-->
<table cellspacing="0" width="100%">
<tr><th>写真</th><th>商品名</th><th>サイズ(mm)</th><th>規格</th><th>税込価格</th><th>数量</th><th>カート</th></tr><!--{/if}-->
と書いてあり、こうしておくとループの1回目しか表示されないので良いと思いますが、
同様に </table> も一回しか表示されないようにしないといけないと思います。

</table> はループの最後1回のみ表示したいので、
<!--{if $smarty.foreach.arrProducts.last}--></table><!--{if}-->
という感じになると思います。

こちらもご参考ください。
http://www.smarty.net/docsv2/ja/language.function.foreach

蛇足)ご要望内容が具体的にわかる題名を付けてください。
help
投稿日時: 2012/2/25 13:11
対応状況: −−−
半人前
登録日: 2012/2/23
居住地:
投稿: 16
Re: 商品一覧ページ
fukap様

ご教授ありがとうございます。
試みてみましたが、システムエラーになってしまいどうしていいかわからず悩んでおります。

商品の一覧を表形式にしたいだけなのにHTMLみたいにうまくはできず・・・。

教えていただき、ありがとうございました。
aska824
投稿日時: 2012/2/26 19:31
対応状況: −−−
長老
登録日: 2010/2/20
居住地: 静岡県
投稿: 185
Re: 商品一覧ページ
もともと表示されていてシステムエラーになる場合はテンプレートの記述がおかしいんだと思います。

パラメータ設定のDEBUG_MODEをtrueにして表示すると、上部に何行目のどの部分の記述かおかしいか表示されますので、それを参考にシステムエラーを回避できます。


----------------
-----------情報-----------
自分の分かる範囲でお答えします。

Shop Mate

help
投稿日時: 2012/2/27 9:28
対応状況: −−−
半人前
登録日: 2012/2/23
居住地:
投稿: 16
Re: 商品一覧ページ
ありがとうございます。
パラメーター設定を変更したので、1度確認してみます。
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

総メンバー数は89,002名です
総投稿数は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.