官方微博: 腾讯  
首页 > ECSHOP教程 > ECSHOP模板教程 > ECSHOP商城首页修改 > ECSHOP首页显示调用自定义分类商品best, new, hot

ECSHOP首页显示调用自定义分类商品best, new, hot

ECSHOP教程 / ecshop 教程网(www.ecshop119.com) 2013-07-06

ECSHOP首页显示调用自定义分类商品best, new, hot

 

首先介绍:首页 调用自定义商品分类精品

index.php

$smarty->assign('cat_id19_best_goods', index_get_cat_id_goods_best_list(19,10));

19是商品分类ID    10显示数量

然后index.dwt :

<!-- {foreach  from=$cat_id19_best_goods item=goods  name=no}-->

<div class="goodsItem goodsItem2" >
  <a href="{$goods.url}"><img  src="{$goods.thumb}" alt="{$goods.name|escape:html}" class="goodsimg"  /></a>
    <p> <a href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.name|escape}</a></p>

      <font class="f1">
    <!-- {if $goods.promote_price neq ""} -->
    {$goods.promote_price}
    <!-- {else}-->
    {$goods.shop_price}
    <!--{/if}-->
    </font>
     <font class="market">{$goods.market_price}</font>
</div>        
<!-- {/foreach} -->

 

 

另外一种:

index.php加入:

 $smarty->assign('new_goods1',       recommend_goods('new',24));

 

模板调用方法:
     <!--{foreach from=$new_goods1
     + item=goods}-->
            <li>
                <div class="ul2_img"><a href="{$goods.url}"><img src="{$goods.thumb}" width="160"  height="212"/></a></div>
                <div class="ul2_details">
                    <div class="bor_r_gray">
                         <p class="ul2_details_title"><a href="{$goods.url}"  title="{$goods.name|escape:html}">{$goods.name|truncate:11:"...":true}</a></p>
                        <!-- {foreach from=$goods.pros item=property_group key=key name=property1} -->
                            <!-- {foreach from=$property_group item=property name=property} -->
                              <!--{if $property.name=="净重"}--> 
                                   <p>净含量:{$property.value|escape:html}</p>
                              <!--{/if}-->                    
                            <!-- {/foreach}-->
                        <!-- {/foreach}--> 
                         <p><span class="market_price">市场价{$goods.market_price}</span><span class="reality_price">模板屋价{$goods.shop_price}</span></p>
                   
                    </div>
                </div>
            </li>
            <!--{/foreach}-->         

 

 

 

转载请注明:ECshop119模板屋-ECshop教程网(全国最专业的ECSHOP插件制作商-专业ECSHOP二次开发)

帮助目录

在线反馈

可以将问题或建议反馈给我们。

提交在线反馈

与网友交流ECSHOP开发修改。

加入QQ群交流