欢迎来到素材无忧网,按 + 收藏我们
登录 注册 退出 找回密码

ecshop首页调用指定商品分类下推荐热销很新商品

时间: 2024-02-25 10:42 阅读: 作者:素材无忧网

其实这个在ecshop中预留这个函数,不知道是不是开发者特意留下,但不想让所有人知道而已,函数在includes/lib_goods.php里面。
下面开始教你如何添加指定分类的下热销产品:
1.在首页index.php中找到
/* 页面中的动态内容 */
assign_dynamic('index');
2.在上面添加如下代码
$children = get_children(1);
$smarty->assign('index_hot_goods_1', get_category_recommend_goods("hot", $children)); // 热销商品
其中分类编号1,根据你想调用分类而填写如果是很新产品就再加上
$children = get_children(1);
$smarty->assign('index_new_goods_1', get_category_recommend_goods("new", $children)); // 很新商品
若果是精品产品
$children = get_children(1);
$smarty->assign('index_best_goods_1', get_category_recommend_goods("best", $children)); // 精品商品
3.然后再模板库文件中新建index_hot_goods_1.lbi。文件内容如下:

  • {$goods.name|escape:html}

    {$goods.short_name|escape:html}

    一口价 {$goods.promote_price} 一口价 {$goods.shop_price}
  • 4.然后在首页模板index.dwt中调用index_hot_goods_1.lbi。
    5.如果有多个分类要调用,可以重复1-3的步骤至于每个调用的商品的数量 ,在后台》》模板设置》》

    版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!

    转载请注明: ecshop首页调用指定商品分类下推荐热销很新商品

    推荐文章
    模板推荐