网店插件,首页列表页显示商品折扣方法

迅睿框架 更新 2026-04-19 20:58:33 又菜又爱玩

网店插件,商品折扣显示方法

第一种

https://www.xunruicms.com/wenda/61986.html

第二种

 {php $rt = \Phpcmf\Service::M('order', 'store')->get_goods_discount($rs.id, $rs.price, $member);}
                                        {if $rt}
                                        <span class="meta-shhop-icon">
                                            <strong style="margin-right: 5px;">
                                            {$rt.info}
                                            </strong>
                                            <del><i class="fa fa-rmb"></i> {number_format($rs.price, 2)}</del>
                                            </span>
                                        {else}
                                        <span class="meta-shhop-icon"><i class="fa fa-rmb"></i> {number_format($rs.price, 2)}</span>
                                        {/if}

第二种简单 只需要套一个if else 即可,是调用order.php里面的函数方法


方案

  • 小五哥 #1 · 2023-03-02 08:54:02
    看看是什么代码,有用
  • 又菜又爱玩 #2 · 2023-03-02 09:22:21
    {if $rt.promotion.type==4||$rt.promotion.type==5}
                                               <i class="fa fa-rmb"></i> {number_format($rs.price, 2)}
                                                {else}
                                                 <del><i class="fa fa-rmb"></i> {number_format($rs.price, 2)}</del>
                                                {/if}
    判断删除线
    效果图
    image
  • 魂 #3 · 2025-03-30 06:37:39
    看看怎么实现的
  • 四分音符 #4 · 2025-09-13 23:07:33
    看看怎么实现的
  • 淇云科技 #5 · 2026-01-21 20:42:18
    看看怎么实现的
  • 39884895 #6 · 2026-04-19 20:58:33
    看看怎么实现的

迅睿系统漏洞

站群分站系统
站群分站系统(2026-10-15)
子站域名新增llms.txt访问
GEO系统
GEO系统(2026-10-14)
修复下载zip空白地址问题 修复流量复刻和任务队列错误
GeoSeo收录宝
GeoSeo收录宝(2026-10-14)
新增 站长工具箱 前端首页自动调用meta 数据
滑块验证码 Gocaptcha
滑块验证码 Gocaptcha(2026-10-13)
基于开源项目 go-captcha 的行为验证码插件,滑动拼图、区域...
GeoSeo工具箱
GeoSeo工具箱(2026-10-13)
优化巡检任务
GeoSeo排名助手
GeoSeo排名助手(2026-10-11)
加入大模型自定义
SEO聚合关键字
SEO聚合关键字(2026-10-11)
优化关键字列表页最多支持1万篇文章,过多会导致服务器扛不住;
CMS内容同步复制
CMS内容同步复制(2026-10-10)
增加时间是否更新的开关