php刷新热销商品,ecshop首页如何调用指定分类下的推荐热销最新商品
其實這個在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.short_name|escape:html}
一口價 {$goods.promote_price}
一口價 {$goods.shop_price}
4.然后在首頁模板index.dwt中調用index_hot_goods_1.lbi。
.如果有多個分類要調用,可以重復1-3的步驟
至于每個調用的商品的數量 ,在后臺》》模板設置》》
總結
以上是生活随笔為你收集整理的php刷新热销商品,ecshop首页如何调用指定分类下的推荐热销最新商品的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 女人本性的47个心理阴暗面 承受力差的谨
- 下一篇: davinci 达芬奇BI工具