您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop商城网站首页怎么显示商品库存
冰兰2023-12-12 23:01:44ecshop商城教程已有人查阅
导读近几日群有人问到“在ECSHOP首页显示商品库存的方法”, 下面是修改方法1、打开 /includes/lib_goods.php 文件(建议使用editplus)
近几日群有人问到“在ECSHOP首页显示商品库存的方法”, 下面是修改方法
1、打开 /includes/lib_goods.php 文件(建议使用editplus)
找到下面代码(大概在287行左右)
/themes/模板文件夹/library/recommend_hot.lbi ,/themes/模板文件夹/library/recommend_new.lbi , /themes/模板文件夹/library/recommend_best.lbi
在
1、打开 /includes/lib_goods.php 文件(建议使用editplus)
找到下面代码(大概在287行左右)
//取出所有符合条件的商品数据,并将结果存入对应的推荐类型数组中
$sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, ' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".
修改为
//取出所有符合条件的商品数据,并将结果存入对应的推荐类型数组中
$sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, ' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, g.goods_number,". 2、
接着,继续向下找到
if (in_array($row['goods_id'], $type_array['best']))
在它上面增加一行代码
$goods[$idx]['goods_number'] = $row['goods_number']; yzzmf.com-->
3、然后再修改模板文件/themes/模板文件夹/library/recommend_hot.lbi ,/themes/模板文件夹/library/recommend_new.lbi , /themes/模板文件夹/library/recommend_best.lbi
在
<font class="f1">
<!-- {if $goods.promote_price neq ""} -->
{$goods.promote_price}
<!-- {else}-->
{$goods.shop_price}
<!--{/if}-->
</font>
下面增加代码
<br>
<!-- {if $goods.goods_number eq 0} -->
<strong>{$lang.goods_number}</strong>
<font color='red'>{$lang.stock_up}</font>
<!-- {else} -->
<strong>{$lang.goods_number}</strong>
{$goods.goods_number} {$goods.measure_unit}
<!-- {/if} -->
3、最后一步记得去ECSHOP后台,清除一下缓存
本文标签:
很赞哦! ()
随机图文
-
删除ecshop您需要激活系统的删除关闭方法
ecshop安装以后打开后台出现ecshop您需要激活系统删除关闭的方法;1.打开后台出现:您需要激活系统 没有关闭按钮,因为他们把关闭按钮注销了 -
ecshop热门搜索关键词怎么显示
设置热门搜索,有两种情况,一种是官方默认的模板,设置起来就比较简单,一步就能搞定;还有一种就是第三方的模板,就稍微复杂一些 -
新ecshop商业授权多少钱,ecshop授权费用
代码号大家详细解说一下ECSHOP授权,ECSHOP商业授权,ECSHOP授权多少钱,ECSHOP授权费用,ECSHOP授权激活码,希望对大家有所帮助! -
ecshop商品列表页和商品详细页分类树跟首页一样的实现方法
如何让商品列表页或商品详情页的分类树都跟首页一样,也是显示全部所有的分类呢?修改方法:(1)、商品列表页修改方法:(1)、商品列表页修改方法:
留言与评论 (共有 条评论) |