首页 > 网站 > 建站经验 > 正文

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

2024-04-25 20:41:35
字体:
来源:转载
供稿:网友

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

<?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}-->

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表