ecshop商品相册_ecshop商品相册显示顺序为正序实现教程

2020-12-18 阅读:1473 来源:模板屋

我们在ECSHOP商城后台更改商品图片后,这张图片就会置于商品相册的最后一个,于是前台显示放大图就会于相册第一张不同,这种情况很是不妙应当如何解决呢?今天由ECSHOP教程网为您详细介绍修改方法教程,修改方法很简单:


打开include/lib_goods.php文件,找到如下代码

$sql = 'SELECT img_id, img_url, thumb_url, img_desc' .
' FROM ' . $GLOBALS['ecs']->table('goods_gallery') .
" WHERE goods_id = '$goods_id' LIMIT " . $GLOBALS['_CFG']['goods_gallery_number'];
$row = $GLOBALS['db']->getAll($sql);
把上面那段代码修改成:
$sql = 'SELECT img_id, img_url, thumb_url, img_desc' .
' FROM ' . $GLOBALS['ecs']->table('goods_gallery') .
" WHERE goods_id = '$goods_id' ORDER BY img_id ASC LIMIT " . $GLOBALS['_CFG']['goods_gallery_number'];
$row = $GLOBALS['db']->getAll($sql);
后台清理下缓存,测试下效果吧!


1473
本文模板屋原创地址:https://www.ecshopkf.com/ecshopjc-1079.html © 模板屋版权所有 转载时必须以链接形式注明出处。
更多ECSHOP教程