在ECSHOP商品列表頁顯示每個商品的品牌

2021-06-26 17:32:45 字數 798 閱讀 2004

1、首先修改 category.php 檔案將

$sql = 'select g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price as org_price, ' .

修改為$sql = 'select g.goods_id, g.goods_name, b.brand_name , g.goods_name_style, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price as org_price, ' .

找到"on mp.goods_id = g.goods_id and mp.user_rank = '$_session[user_rank]' " .

在它下面增加一行

" left join  ". $globals['ecs']->table('brand') . " as b on b.brand_id = g.brand_id " .

繼續,找到

$arr[$row['goods_id']]['name']             = $row['goods_name'];

在它下邊增加一行

$arr[$row['goods_id']]['brand_name']             = $row['brand_name'];

2、接下來開啟模板庫檔案 /themes/default/library/goods_list.lbi

想在哪顯示品牌就在哪加入下面的**

ecshop模板首頁或列表頁顯示商品簡單描述

1 在ecshop首頁顯示商品簡單描述 依次開啟 themes default library recommend hot.lbi themes default library recommend new.lbi themes default library recommend best.lbi 檔...

ecshop模板首頁或列表頁顯示商品簡單描述

1 在ecshop首頁顯示商品簡單描述 依次開啟 themes default library recommend hot.lbi themes default library recommend new.lbi themes default library recommend best.lbi 檔...

ecshop在商品列表顯示購買記錄

遇到這樣的需求不用自己寫 很多都是官方寫好的,商品詳細頁本來就有個購買記錄,我們開啟goods.php就會看到 sql select count from ecs table order info as oi left join ecs table users as u on oi.user id ...