修改includes\lib_goods.php 文件,在(即注释“/* 获得商品的销售价格 ”)后面添加: $row['sheng_price'] = $row['market_price']-$row['shop_price']; $row['zhekou_price'] = round(($row['shop_price']/$row['market_price'])*100)/10+""; $row['cuxiao_sheng_price'] = $row['market_price']-$row['promote_price']; $row['cuxiao_zhekou_price'] = round(($row['promote_price']/$row['market_price'])*100)/10+""; (想要在商品详情页添加促销价的折扣和节省的自己再如法炮制一段添加其后就可以了,以前网友弄的这个显示出来6折显示60折,不符合生活习惯,所以我就在后面除以十了,这样就符合现代规范) 到goods.dwt中找到市场价和促销价那一栏后面添加(当然你想添加什么地方都可以,看你自己感觉怎么美观了): 折扣:{$goods.zhekou_price} 折 节省:{$goods.sheng_price} 元 促销期间折扣:{$goods.cuxiao_zhekou_price} 折 节省:{$goods.cuxiao_sheng_price} 元
|