关于ecshop调用指定分类下新品热卖推荐促销的又一方法

2016-09-11 20:39 来源:www.chinab4c.com 作者:ecshop专家

 想要在ecshop首页调用某个指定分类,方法如下:

<ul class="lh style3">

<?php $children1=g et_children(391); $this->

assign('cat1_promote_goods', get_category_recommend_goods('promote',$children1,8));

?>

<!--{foreach from=$cat1_promote_goods item=goods name=gcurn}-->

             //

<li class="fore{$smarty.foreach.gcurn.iteration}">

<div class="p-img ld">

<a href="{$goods.url}" title="{$goods.name|escape:html}" class="litpic"

target="_blank">

<img src="{$goods.goods_thumb_category}" alt="{$goods.name|escape:html}"

height="150" width="150">

</a>

</div>

<div class="p-name">

<a href="{$goods.url}" title="{$goods.name|escape:html}" target="_blank">

{$goods.name|escape:html}

</a>

</div>

<div class="p-price">

<!-- {if $goods.promote_price neq ""} -->

{$goods.promote_price}

<!-- {else}-->

{$goods.shop_price}

<!--{/if}-->

</div>

</li>

<!--{/foreach}-->

</ul>

 

关键部分: <?php              $children1 = get_children(391);              $this->assign('cat1_promote_goods', get_category_recommend_goods('promote',$children1,8));        ?>

391就是调用的分类ID,替换即可!如果要其他属性,请替换promote未new hot best 等属性!