怎样在首页调用商品详细描述?
2016-07-07 15:01 来源:www.chinab4c.com 作者:ecshop专家
怎样在首页调用商品详细描述?说详细说哦,最好贴代码,我是新手 |
回答:
首页商品,有很多区域,促销、新品、热卖、推荐、分类商品、等等等等,你应该具体说明你想在首页哪个区域的商品调用详细描述。 以新品、推荐、热卖为例 修改 includes/lib_goods.php 文件,找到 get_recommend_goods 函数部分 修改下面代码,红色为新增加的 $sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.goods_desc, g.market_price, g.shop_price AS org_price, g.promote_price, ' . "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ". "promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img, RAND() AS rnd " . 'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ". "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' "; $type_merge = array_merge($type_array['new'], $type_array['best'], $type_array['hot']); $type_merge = array_unique($type_merge); $sql .= ' WHERE g.goods_id ' . db_create_in($type_merge); $sql .= ' ORDER BY g.sort_order, g.last_update DESC'; $result = $GLOBALS['db']->getAll($sql); foreach ($result AS $idx => $row) { if ($row['promote_price'] > 0) { $promote_price = bargain_price($row['promote_price'], $row['promote_start_date'], $row['promote_end_date']); $goods[$idx]['promote_price'] = $promote_price > 0 ? price_format($promote_price) : ''; } else { $goods[$idx]['promote_price'] = ''; } $goods[$idx]['id']= $row['goods_id']; $goods[$idx]['name']= $row['goods_name']; $goods[$idx]['goods_desc']= sub_str(strip_tags($row['goods_desc']), 50); $goods[$idx]['brief']= $row['goods_brief']; $goods[$idx]['brand_name']= isset($goods_data['brand'][$row['goods_id']]) ? $goods_data['brand'][$row['goods_id']] : ''; $goods[$idx]['goods_style_name']= add_style($row['goods_name'],$row['goods_name_style']); ...................... 接下来就是在 /themes/default/library/recommend_best.lbi /themes/default/library/recommend_hot.lbi /themes/default/library/recommend_new.lbi 几个文件中的调用了。。 这么调用 {$goods.goods_desc} 主要调用代码 要放在循环里面 以上只是 新品、 热卖、 推荐、里的修改方法,首页其他区域商品修改方法雷同,举一反三吧 |
很容易。先取得goods_desc,然后再显示 |
最近更新
常用插件
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
ecshop热门问答
ecshop热门资料
ecshop陪送
ecshop红包不限使用次数
ecshop客服中心
ecshop我的朋友
ecshop后台登陆不了
ecshop乱码 新装
ecshop销量排行
ecshop无知
ecshop答案
ecshop重新
ecshop退款原理
ecshop输入
ecshop红包验证
ecshop表单
ecshopWebATM
ecmall分类购买
ecshop详细资料
ecshop阶梯
ecshop调取
ecshop模拟
ecshop盾牌
ecshop商品编码
ecshop广告添加问题
ecshop右边
ecshop后台数据库
ecshopuft8
ecshop在线申请
ecshop乱码
ecshop营业执照
ecshop帮助中心