カラーミーショップ!プロhttp://shop-pro.jp/で、TOPページでカテゴリ毎におすすめ商品を出す方法。

カラーミーショップ!プロhttp://shop-pro.jp/にて、TOPページでカテゴリ毎にっぽくおすすめ商品を出す方法。
あくまで「っぽく」だけ。

カラーミーショップ!プロhttp://shop-pro.jp/にて、TOPページでカテゴリ毎にっぽくおすすめ商品を出す方法。
あくまで「っぽく」だけ。

<{section name=num loop=$recommend}>

<{if ($smarty.section.num.iteration == 1)}>
<div >
<a href=”<{$category[0].link_url}>” style=”text-decoration:none;”><{$category[0].name}></a>
</div>
<{elseif ($smarty.section.num.iteration == 7) }>
<div >
<a href=”<{$category[1].link_url}>” style=”text-decoration:none;”><{$category[1].name}></a>
</div>
<{/if}>

<div class=”itemarea”>
<div><{if $recommend[num].img_url != “”}><a href=”<{$recommend[num].link_url}>” /><img src=”<{$recommend[num].img_url}>” class=”border” /></a><{else}><a href=”<{$recommend[num].link_url}>” /><img src=”http://img.shop-pro.jp/tmpl_img/17/noimg.gif” class=”border” /></a><{/if}></div>
<a href=”<{$recommend[num].link_url}>” /><{$recommend[num].name}></a><br />
<{$recommend[num].price}>
</div>
<!– 6個で改行(最後は含まない) –><{if $smarty.section.num.iteration % 6 == 0 and $smarty.section.num.last == false}><br class=”clear” />
<{/if}>

<{/section}>

要は、 smarty.section.num.iterationを参照して、6個目で改行させて、

7個目で

<div >
<a href=”<{$category[1].link_url}>” style=”text-decoration:none;”><{$category[1].name}></a>
</div>

を表示させる。適当だけど。
管理画面の表示順で、1-6番目までは、category[0].nameとして、
管理画面の表示順で、7-12番目までは、category[1].nameとして、
表示される。
後はcssで整形するのだー。

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.