2016/05/09
ECCUBE2.13
備忘録です。
ランキングの追加カスタムやプラグインはあるのですが、
だたアナログ的におすすめ商品をそのままランキングに転用して数値を出す方法です。
おすすめ商品のブロックに追加します。
<!--{if count($arrBestProducts) > 0}-->
<div class="block_outer clearfix">
<div id="recommend_area">
<h2><img src="<!--{$TPL_URLPATH}-->img/title/tit_bloc_recommend.jpg" alt="*" class="title_icon" /></h2>
<div class="block_body clearfix">
<!--{assign var="var" value="1"}--> <!--追加-->
<!--{foreach from=$arrBestProducts item=arrProduct name="recommend_products"}-->
<div class="product_item clearfix">
<span>No.<!--{$var}--></span> <!--追加 数値表示 CSSで修飾-->
<div class="productImage">
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->">
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrProduct.main_list_image|sfNoImageMainList|h}-->&width=80&height=80" alt="<!--{$arrProduct.name|h}-->" />
</a>
</div>
<div class="productContents">
<h3>
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->"><!--{$arrProduct.name|h}--></a>
</h3>
<p class="sale_price">
<!--{$smarty.const.SALE_PRICE_TITLE}-->(税込): <span class="price"><!--{$arrProduct.price02_min_inctax|number_format}--> 円</span>
</p>
<p class="mini comment"><!--{$arrProduct.comment|h|nl2br}--></p>
</div>
</div>
<!--{if $smarty.foreach.recommend_products.iteration % 2 === 0}-->
<div class="clear"></div>
<!--{/if}-->
<!--{assign var="var" value=$var+1}--> <!--追加-->
<!--{/foreach}-->
</div>
</div>
</div>
<!--{/if}-->
これで数値を取得して表示できます。
ランキングブロックをカスタムで追加するよりも簡単です。
ゼヒトモ内でのプロフィール: ROCKSTREAM, ゼヒトモのホームページ作成・制作サービス, 仕事をお願いしたい依頼者と様々な「プロ」をつなぐサービス
2025/01/31
JQuery
2025/01/01
神社
御朱印
相模原
2024/10/27
ブラウザ
カスタム投稿
Wordpress
2024/08/20
神社
御朱印
2024/07/06
神社
御朱印