您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程

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

黎舒旺2023-12-15 21:43:27ecshop商城教程已有人查阅

导读ECSHOP首页显示调用自定义分类商品best, new, hot首先介绍:首页 调用自定义商品分类精品index.php

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

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签