A5下载文章资讯

分类分类

ecshop指定调取某分类的热销产品

2015-09-06 09:17作者:fang

这个是最简洁的办法,也是最可靠的办法,比网上搜索来的方法快捷多了,修改也简单

<?php

$this->assign('top_goods_1' , get_top10(12));//分类12

?>

<!-- {foreach name=top_goods from=$top_goods_1 item=goods}-->

<!-- {if $smarty.foreach.top_goods.iteration<2}-->

<LI class=fore><SPAN>{$smarty.foreach.top_goods.iteration}</SPAN>

<DIV class=p-img><a href="{$goods.url}"><IMG height=50 src="{$goods.thumb}" alt="{$goods.goods_name|escape:html}" width=50></A></DIV>

<DIV class=p-name><a href="{$goods.url}" title="{$goods.goods_name|escape:html}">{$goods.goods_name}</A></DIV>

<DIV class=p-price><STRONG>{$goods.price}</STRONG></DIV></LI>

<!-- {/if} -->

<!-- {if $smarty.foreach.top_goods.iteration>1}-->

<LI><SPAN>{$smarty.foreach.top_goods.iteration}</SPAN>

<DIV class=p-name><a href="{$goods.url}" title="{$goods.goods_name|escape:html}">{$goods.goods_name}</A></DIV></LI>

<!-- {/if} -->

<!--{/foreach}-->

展开全部

相关

说两句网友评论
    我要跟贴
    取消