バージョン選択

フォーラム

メニュー

オンライン状況

47 人のユーザが現在オンラインです。 (39 人のユーザが フォーラム を参照しています。)
登録ユーザ: 1
ゲスト: 46
n.a.k.s もっと...

サイト内検索

質問 > フロント機能 > EC-CUBEのおすすめ商品を3列に増やしたのですが…

フロント機能

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
konikoni
投稿日時: 2011/6/24 20:55
対応状況: −−−
新米
登録日: 2011/6/9
居住地:
投稿: 10
EC-CUBEのおすすめ商品を3列に増やしたのですが…
3列に増やしてみたのですが、3列目の商品の価格が0になってしまいます。過去のスレッドなども確認してみたのですが、解決できず…。

図々しいとは思いますが、もしよろしければ教えていただければと思います。


<!--{if count($arrBestProducts) > 0}-->
<div class="bloc_outer clearfix">
<div id="recomend_area">
<h2><img src="<!--{$TPL_URLPATH}-->img/title/tit_bloc_recommend.jpg" alt="*" class="title_icon" /></h2>
<!--{section name=cnt loop=$arrBestProducts step=3}-->
<div class="bloc_body clearfix">
<div class="recomendleft clearfix">
<div class="productImage">
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrBestProducts[cnt].product_id|u}-->">
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrBestProducts[cnt].main_list_image|sfNoImageMainList|h}-->&width=150&height=150" alt="<!--{$arrBestProducts[cnt].name|h}-->" /></a>
</div>
<div class="productContents">
<h3>
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrBestProducts[cnt].product_id|u}-->"><!--{$arrBestProducts[cnt].name|h}--></a>
</h3>
<!--{assign var=price01 value=`$arrBestProducts[cnt].price01_min`}-->
<!--{assign var=price02 value=`$arrBestProducts[cnt].price02_min`}-->
<p class="sale_price">価格(税込):
<span class="price"><!--{$price02|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}--> 円</span>
</p>
<p class="mini comment"><!--{$arrBestProducts[cnt].comment|h|nl2br}--></p>
</div>
</div>

<div class="recomendleft clearfix">
<div class="productImage">
<!--{assign var=cnt2 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-2`}-->
<!--{if $arrBestProducts[$cnt2]|count > 0}-->

<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrBestProducts[$cnt2].product_id|u}-->">
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrBestProducts[$cnt2].main_list_image|sfNoImageMainList|h}-->&width=150&height=150" alt="<!--{$arrBestProducts[$cnt2].name|h}-->" /></a>
</div>
<div class="productContents">
<h3>
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrBestProducts[$cnt2].product_id|u}-->"><!--{$arrBestProducts[$cnt2].name|h}--></a>
</h3>

<!--{assign var=price01 value=`$arrBestProducts[$cnt2].price01_min`}-->
<!--{assign var=price02 value=`$arrBestProducts[$cnt2].price02_min`}-->

<p class="sale_price">価格(税込):
<span class="price"><!--{$price02|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}--> 円</span>
</p>
<p class="mini comment"><!--{$arrBestProducts[$cnt2].comment|h|nl2br}--></p>
<!--{/if}-->
</div>
</div>

<div class="recomendright clearfix">
<div class="productImage">
<!--{assign var=cnt2 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-1`}-->
<!--{if $arrBestProducts[$cnt2]|count > 0}-->

<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrBestProducts[$cnt2].product_id|u}-->">
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrBestProducts[$cnt2].main_list_image|sfNoImageMainList|h}-->&width=150&height=150" alt="<!--{$arrBestProducts[$cnt2].name|h}-->" /></a>
</div>
<div class="productContents">
<h3>
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrBestProducts[$cnt2].product_id|u}-->"><!--{$arrBestProducts[$cnt2].name|h}--></a>
</h3>

<!--{assign var=price01 value=`$arrBestProducts[$cnt3].price01_min`}-->
<!--{assign var=price02 value=`$arrBestProducts[$cnt3].price02_min`}-->

<p class="sale_price">価格(税込):
<span class="price"><!--{$price02|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}--> 円</span>
</p>
<p class="mini comment"><!--{$arrBestProducts[$cnt2].comment|h|nl2br}--></p>
<!--{/if}-->
</div>
</div>

</div>
<!--{/section}-->
</div>
</div>
<!--{/if}-->
fukap
投稿日時: 2011/6/24 21:21
対応状況: −−−
仙人
登録日: 2009/7/7
居住地: 滋賀県
投稿: 907
Re: EC-CUBEのおすすめ商品を3列に増やしたのですが…
2列目のカウンタを cnt2 、3列目のカウンタを cnt3 と定義するなら、
大雑把なコードの構造は以下のようになります。

<!--{section name=cnt loop=$arrBestProducts step=3}-->
  この中では cnt を使う
<!--{assign var=cnt2 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-2`}-->
  この中では $cnt2 を使う
<!--{assign var=cnt3 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-1`}-->
  この中では $cnt3 を使う
<!--{/section}-->

ですので、3列目のカウンタを定義するコードは以下のようにすると良いかと。

<!--{assign var=cnt3 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-1`}-->

そして、3列目の商品情報を出力するコード内で、$cnt2 を $cnt3 にするとうまくいくかと思います。
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

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

投稿数ランキング

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