熱銷商品查詢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。
5.如果有多個分類要調用,可以重復1-3的步驟
至于每個調用的商品的數量 ,在后臺》》模板設置》》
總結
以上是生活随笔為你收集整理的熱銷商品查詢php,ecshop首页调用指定商品分类下推荐热销最新商品的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微阵列芯片服务器,功能性分群于微阵列芯片
- 下一篇: 什么叫迭代法?