ECSHOP商品页调用热销商品的教程
在goods.php里面加了$smarty->assign('hot_goods', get_recommend_goods('hot')); // 获取热销商品。
在goods.dwt加入了如下代码,
<!--{foreach from=$hot_goods item=hotgoods}--> <li> <a href="{$hotgoods.url}"><img width="50" height="50" src="{$hotgoods.thumb}" alt="{$hotgoods.name|escape:html}" title="{$hotgoods.name|escape:html}" target="_blank"></a> <a href="{$hotgoods.url}" target="_blank" title="{$hotgoods.name|escape:html}">{$hotgoods.short_style_name}</a><br/> <b><!-- {if $hotgoods.promote_price neq ""} --> {$hotgoods.promote_price} <!-- {else}--> {$hotgoods.shop_price} <!--{/if}--></b> </li> <!--{/foreach}-->
后台模板设置,控制商品数量显示