求助:ECSHOP团购列表如何调用产品大图而不是缩略图
2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家
ECSHOP团购列表页默认调用的是缩略图,<img src="{$group_buy.goods_thumb}" ,团购列表页的图片我需要大图,缩略图太小了,<img src="{$group_buy.goods_goods_img}''我改成这样以后,图片就获取不到,请各位大仙帮忙。。。 团购详情页也一样,<img src="{$gb_goods.goods_thumb}"把thumb改为goods_img 同样调用不到图片 团购详情页改成<img src="{$gb_goods.goods_img}"就可以了,列表页不行 |
回答:
{$group_buy.goods_img}这样呢 |
试过了,不行,图片不显示 |
你们就知道模板调用。 模板调用标签是怎么来的,那是程序赋值的,才能调用,程序没给他赋值,调用一辈子也调不出来呀。 这个需要修改PHP文件 修改 group_buy.php 将
g.goods_thumb 改成 g.goods_img 模板调用不变,还是 <img src="{$group_buy.goods_thumb}" |
function group_buy_list($size, $page) { /* 取得团购活动 */ $gb_list = array(); $now = gmtime(); $sql = "SELECT b.*, IFNULL(g.goods_img, '') AS goods_thumb, b.act_id AS group_buy_id, ". "b.start_time AS start_date, b.end_time AS end_date " . "FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS b " . "LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON b.goods_id = g.goods_id " . "WHERE b.act_type = '" . GAT_GROUP_BUY . "' " . "AND b.start_time <= '$now' AND b.is_finished < 3 ORDER BY b.act_id DESC"; $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size); while ($group_buy = $GLOBALS['db']->fetchRow($res)) { $ext_info = unserialize($group_buy['ext_info']); $group_buy = array_merge($group_buy, $ext_info); /* 格式化时间 */ $group_buy['formated_start_date']= local_date($GLOBALS['_CFG']['time_format'], $group_buy['start_date']); $group_buy['formated_end_date']= local_date($GLOBALS['_CFG']['time_format'], $group_buy['end_date']); /* 格式化保证金 */ $group_buy['formated_deposit'] = price_format($group_buy['deposit'], false); /* 处理价格阶梯 */ $price_ladder = $group_buy['price_ladder']; if (!is_array($price_ladder) || empty($price_ladder)) { $price_ladder = array(array('amount' => 0, 'price' => 0)); } else { foreach ($price_ladder as $key => $amount_price) { $price_ladder[$key]['formated_price'] = price_format($amount_price['price']); } } $group_buy['price_ladder'] = $price_ladder; /* 处理图片 */ if (empty($group_buy['goods_thumb'])) { $group_buy['goods_thumb'] = get_image_path($group_buy['goods_id'], $group_buy['goods_thumb'], true); } /* 处理链接 */ $group_buy['url'] = build_uri('group_buy', array('gbid'=>$group_buy['group_buy_id'])); /* 加入数组 */ $gb_list[] = $group_buy; } return $gb_list; } 红色的部分就是改的,改完之后就加载了系统默认的图片,加载不到团购商品的图片 |
最近更新
常用插件
- 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火车采集器
ecshopBrowser
ecshopwifi
ecshopauto
后台密码
ecshop发送者
ecshop领取
ecshop编码问题
ecshop加拿大
ecshop长沙php
iecshop
ecshop图标
ecshop赠品
ecshop属性排序
ecshop黑函
ecshop更新数量
ecshop改改
ecshop配送地址
ecshop会员等级显示
ecshop河南郑州
ecshop祝福卡
ecshop页面乱了
ecshop缩略图失直
ecshop501
ecshopEcshop后台
ecshoppaypal
ecshopgiven
gucci sunglasses
ecshop翻译