バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > フロント機能 > オススメ商品(best5.tpl)について

フロント機能

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
ゲスト
投稿日時: 2008/4/22 20:43
対応状況: −−−
オススメ商品(best5.tpl)について
トップページに表示するオススメ商品を2列づつ繰り返し
表示するという形式にしたいのですが変更しながらテスト
していたら表示されるものの4つしか表示されなくなって
しまいました・・・(汗

現在のbest5.tplは下記のようになっております。
変数のミスだとは思うのですが修正する箇所が何度見ても
わかりませんでした。
大変お手数ですが添削をお願いできますでしょうか?


<!--▼おすすめ情報ここから-->
<div id="recomendarea">
<h2>
<img src="<!--{$TPL_DIR}-->img/org/osusume.gif" width="588" height="30" alt="おすすめ情報" />
</h2>
<!--{section name=cnt loop=$arrBestProducts step=3}-->

<div class="recomendblock">
<div class="recomendleft">
<!--{if $arrBestProducts[cnt].main_list_image != ""}-->
<!--{assign var=image_path value="`$arrBestProducts[cnt].main_list_image`"}-->
<!--{else}-->
<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
<!--{/if}-->

<p><a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[cnt].product_id}-->">
<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path|sfRmDupSlash}-->&width=130&height=130" alt="<!--{$arrBestProducts[cnt].name|escape}-->" />
</a></p>

<h3>
<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[cnt].product_id}-->"><!--{$arrBestProducts[cnt].name|escape}--></a>
</h3>

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

<p><span class="price">
<!--{if $price02 == ""}-->
<!--{$price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{else}-->
<!--{$price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{/if}-->円 (税込み)</span>
</p>
</div>

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

<p><a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[$cnt2].product_id}-->">
<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path|sfRmDupSlash}-->&width=130&height=130" alt="<!--{$arrBestProducts[$cnt2].name|escape}-->" />
</a></p>

<h3>
<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[$cnt2].product_id}-->"><!--{$arrBestProducts[$cnt2].name|escape}--></a>
</h3>

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

<p><span class="price">
<!--{if $price02 == ""}-->
<!--{$price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{else}-->
<!--{$price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{/if}-->円 (税込み)</span>
</p>

<!--{/if}-->
</div>

</div>
<!--{/section}-->
</div>
<!--▲おすすめ情報ここまで-->
seasoft
投稿日時: 2008/6/12 23:04
対応状況: −−−
登録日: 2008/6/4
居住地:
投稿: 7367
Re: オススメ商品(best5.tpl)について
初 Smarty
なんか、PHP only の方が簡単だなぁ…

けど、書き換えは少なかったかも。

引用:

<!--▼おすすめ情報ここから-->
<div id="recomendarea">
<h2>
<img src="<!--{$TPL_DIR}-->img/top/osusume.jpg" width="400" height="29" alt="おすすめ情報" />
</h2>
<table>
<!--{section name=cnt loop=$arrBestProducts step=3}-->
<tr>
<td>
<!--{if $arrBestProducts[cnt].main_list_image != ""}-->
<!--{assign var=image_path value="`$arrBestProducts[cnt].main_list_image`"}-->
<!--{else}-->
<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
<!--{/if}-->

<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[cnt].product_id}-->">
<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path|sfRmDupSlash}-->&width=48&height=48" alt="<!--{$arrBestProducts[cnt].name|escape}-->" />
</a>

<h3>
<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[cnt].product_id}-->"><!--{$arrBestProducts[cnt].name|escape}--></a>
</h3>

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

<p>価格<span class="mini">(税込)</span>:<span class="price">
<!--{if $price02 == ""}-->
<!--{$price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{else}-->
<!--{$price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{/if}-->円
</span>
</p>
<p class="mini"><!--{$arrBestProducts[cnt].comment|escape|nl2br}--></p>
</td>

<td>
<!--{assign var=cnt2 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-2` }-->
<!--{if $arrBestProducts[$cnt2]|count > 0}-->
<!--{if $arrBestProducts[$cnt2].main_list_image != ""}-->
<!--{assign var=image_path value="`$arrBestProducts[$cnt2].main_list_image`"}-->
<!--{else}-->
<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
<!--{/if}-->

<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[$cnt2].product_id}-->">
<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path|sfRmDupSlash}-->&width=48&height=48" alt="<!--{$arrBestProducts[$cnt2].name|escape}-->" />
</a>

<h3>
<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[$cnt2].product_id}-->"><!--{$arrBestProducts[$cnt2].name|escape}--></a>
</h3>

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

<p>価格<span class="mini">(税込)</span>:<span class="price">
<!--{if $price02 == ""}-->
<!--{$price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{else}-->
<!--{$price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{/if}-->円</span>
</p>

<p class="mini"><!--{$arrBestProducts[$cnt2].comment|escape|nl2br}--></p>
<!--{/if}-->
</td>


<td>
<!--{assign var=cnt2 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-1` }-->
<!--{if $arrBestProducts[$cnt2]|count > 0}-->
<!--{if $arrBestProducts[$cnt2].main_list_image != ""}-->
<!--{assign var=image_path value="`$arrBestProducts[$cnt2].main_list_image`"}-->
<!--{else}-->
<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
<!--{/if}-->

<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[$cnt2].product_id}-->">
<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path|sfRmDupSlash}-->&width=48&height=48" alt="<!--{$arrBestProducts[$cnt2].name|escape}-->" />
</a>

<h3>
<a href="<!--{$smarty.const.URL_DIR}-->products/detail.php?product_id=<!--{$arrBestProducts[$cnt2].product_id}-->"><!--{$arrBestProducts[$cnt2].name|escape}--></a>
</h3>

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

<p>価格<span class="mini">(税込)</span>:<span class="price">
<!--{if $price02 == ""}-->
<!--{$price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{else}-->
<!--{$price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->
<!--{/if}-->円</span>
</p>

<p class="mini"><!--{$arrBestProducts[$cnt2].comment|escape|nl2br}--></p>
<!--{/if}-->
</td>


</tr>
<!--{/section}-->
</table>

</div>
<!--▲おすすめ情報ここまで-->


面倒だってんで、<div> → <table><tr><td> しちゃいました


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

スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

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

投稿数ランキング

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